Set command is not working in DOS

August 26, 2010 at 08:07:07
Specs: DOS
Hi ,
I have the below batch script.

set /a low_release_num+=1
for /l %%a in (15,1,60) do (
findstr /n "^" rcf.log| find /i "%%a" >%tmp%.\$
for /f "tokens=2 delims=:" %%x in (%tmp%.\$) do set release=%%x
echo %release%
del %tmp%.\$
)

In the above script, I want to set second token of the string into the variable called release,when I echo the value of release,it is showing as echo off instead of the value.
if i check the same script in console (not in batch) the string is getting stored in the variable,but the same is not happening in batch mode.
Can any one help and explain why is this and how can i set the string in a variable??

Thanks inadvance.


See More: Set command is not working in DOS

Report •

#1
August 26, 2010 at 08:18:09
The Disk Operating System's shell, COMMAND.COM does not support the /A switch for SET.
The Disk Operating System's shell, COMMAND.COM does not support any flags for FOR.
The Disk Operating System's shell, COMMAND.COM does not support grouping commands with parenthesis.
No known version of the Disk Operating System includes the command FINDSTR.

Are you sure you're using an operating system retired 15 years ago?


Report •

#2
August 26, 2010 at 10:02:38
I think he mistakenly feels NT COMMAND PROMPT CMD.EXE is MS-DOS...

http://ss64.com/nt/

http://ss64.com/nt/syntax.html


Report •
Related Solutions


Ask Question