Search found 40 matches
- 13 Jan 2021 07:49
- Forum: DOS Batch Forum
- Topic: Menu with with GETINPUT.EXE - Problems
- Replies: 2
- Views: 194
Re: Menu with with GETINPUT.EXE - Problems
The 'setlocal' is not hard to explain and easy to solve. The setlocals and initialization of variables is done every time you return to label :START So every time you use 2 additional setlocal calls without ending those with endlocal and there is a limit to the maximum available setlocals to use. So...
- 20 Oct 2020 06:17
- Forum: DOS Batch Forum
- Topic: Creating a custom html generator in batch
- Replies: 9
- Views: 1726
Re: Creating a custom html generator in batch
echo "<iframe src='myfile.html' frameborder='0' height='100%' width='100%'></iframe>" > index.html echo "myfile.html here" >myfile.html rem set variables with set "var=..." to get rid of the double quots. set "var1=<iframe src='myfile.html' frameborder='0' height='100%' width='100%'></iframe>" set ...
- 22 Sep 2020 12:55
- Forum: DOS Batch Forum
- Topic: How to use a POST request in batch with curl.exe?
- Replies: 8
- Views: 1878
Re: How to use a POST request in batch with curl.exe?
See the curl manual/tutorial at https://curl.haxx.se/docs/manual.html
- 19 Sep 2020 16:41
- Forum: DOS Batch Forum
- Topic: Firewall Blocker for Windows - Using netsh.exe
- Replies: 2
- Views: 1129
Re: Firewall Blocker for Windows - Using netsh.exe
The opposite of 'add rule' is 'delete rule'
See
See
Code: Select all
netsh advfirewall firewall delete rule /?
- 18 Sep 2020 03:12
- Forum: DOS Batch Forum
- Topic: How to pass "chcp 1252" command to START "" /B /WAIT program?
- Replies: 4
- Views: 1289
Re: How to pass "chcp 1252" command to START "" /B /WAIT program?
try these start "" /NORMAL /B /WAIT >nul "%windir%\system32\chcp.com" 1252 & "D:\foobar\myprog.exe /parm1 /parm2 someparm” start "" /NORMAL /B /WAIT >nul "chcp" 1252 & "D:\foobar\myprog.exe /parm1 /parm2 someparm” start "" /NORMAL /B /WAIT >nul chcp 1252 & "D:\foobar\myprog.exe /parm1 /parm2 somepar...
- 17 Sep 2020 04:43
- Forum: DOS Batch Forum
- Topic: How to handle file names with &
- Replies: 2
- Views: 1173
Re: How to handle file names with &
protect set variable from special characters by using double quotes. change set var=value to set "var=value" protect echo variable from special characters by using double quotes. change echo %var% to echo "%var%" The quotes will be visible in the output. If you don't want visible quotes you will hav...
- 11 Sep 2020 03:12
- Forum: DOS Batch Forum
- Topic: command retunrs no value even though entry exists
- Replies: 16
- Views: 3465
Re: command retunrs no value even though entry exists
Is seems there is something in you Folders.txt that is not visible in the lines you have posted. You need to examine what is going on inside the for-loop to see why it fails on Runescape. Add the following code to yout batchfile, run it and check the new file FolderDEBUG.txt "%SrcPath%\foldersDEBUG....
- 30 Aug 2020 06:23
- Forum: DOS Batch Forum
- Topic: Copy Filename - Copy File to other directory - duplicate file - filename+continuous numerating
- Replies: 12
- Views: 2017
Re: Copy Filename - Copy File to other directory - duplicate file - filename+continuous numerating
In your code you only keep the last 4 characters of the file. This is probably an attempt to just keep the extension including separator dot between filename and extensions. This is wrong because the extension length can vary between zero (no extension) and a lanrge number, example file: a.bcdefghij...
- 08 Aug 2020 13:08
- Forum: DOS Batch Forum
- Topic: [SOLVED] Output gets directed to the wrong folder!
- Replies: 2
- Views: 1064
Re: Output gets directed to the wrong folder!
Your "Report.bat" is located in PBU\bin
So your code expands to PBU\bin\Reports\Reports.txt
The code below will set the Output_File to PBU\Reports\Reports.txt
So your code expands to PBU\bin\Reports\Reports.txt
The code below will set the Output_File to PBU\Reports\Reports.txt
Code: Select all
cd /d "%~dp0"
set "Output_File=..\Reports\Report.txt"
- 02 Aug 2020 14:12
- Forum: DOS Batch Forum
- Topic: FOR variable %%A in macro definition gets overridden when script is called by other script within FOR loop
- Replies: 15
- Views: 2605
Re: FOR variable %%A in macro definition gets overridden when script is called by other script within FOR loop
The problem is in the for''s. You don't want the %%A used when you define your macro but only when you use the macro. The cause of your problem is the for %%g loop in caller.cmd. This for loop makes the %%A available in the do command block. In your example code you don't need this loop. replace for...
- 01 Aug 2020 13:10
- Forum: DOS Batch Forum
- Topic: Categorize file extension in .txt output
- Replies: 3
- Views: 1203
Re: Categorize file extension in .txt output
unttested, but this should be close to what you are trying to achieve.
Code: Select all
if exist Files.txt del Files.txt
for %%A in (asi ini cs asi) do dir /O:D /T:W *.%%A >> Files.txt
for %%A in (asi ini cs asi) do dir /O:D /T:W /s *.%%A >> Files.txt
- 12 Jun 2020 13:52
- Forum: DOS Batch Forum
- Topic: Batch hex edit offset from filename
- Replies: 8
- Views: 2264
Re: Batch hex edit offset from filename
For work I regularly end up with a bunch of hex files with the extension .hex, but I can have anywhere from 5 all the way up to in the hundreds. Most of the time the files will be the same, but require me to open them and edit a select set of values before saving and closing. Right now I am using H...
- 07 Apr 2020 01:45
- Forum: DOS Batch Forum
- Topic: Batch - Browse directory not work
- Replies: 3
- Views: 1646
Re: Batch - Browse directory not work
Your subroutine :treatment is missing the 'end subroutine' command.
This causes processing of :treatment to continue with the command in :end, so processing stops with the''exit %CodeRetour%' command.
Add 'exit/B' or 'goto :eof' at the end of the subroutine to correct this.
This causes processing of :treatment to continue with the command in :end, so processing stops with the''exit %CodeRetour%' command.
Add 'exit/B' or 'goto :eof' at the end of the subroutine to correct this.
- 28 Feb 2020 06:03
- Forum: DOS Batch Forum
- Topic: How to replace extension of a filename stored in variable?
- Replies: 6
- Views: 4844
Re: How to replace extension of a filename stored in variable?
The 'set "file2=%%~i"' does work, but is done inside the for-commandblock enclosed in ()
Use delayed expansion to echo and use the uptodate value of %file2%.
Change %file2% in !file2! and %newfile2% in !newfile2! and your code will work as expected.
Use delayed expansion to echo and use the uptodate value of %file2%.
Change %file2% in !file2! and %newfile2% in !newfile2! and your code will work as expected.
- 07 Dec 2011 15:14
- Forum: DOS Batch Forum
- Topic: Searching Double quote using FINDSTR inside FOR
- Replies: 4
- Views: 3584
Re: Searching Double quote using FINDSTR inside FOR
or with less carets but more ""
Code: Select all
FOR /f "tokens=1 delims=:" %a in ('"FINDSTR /n /c:"^"" s.txt"') do echo %a