Error with conditional command use
Posted: 17 Dec 2011 04:55
I am trying to make a command called "stop /message=(something)" and it is supposed to do the same thing as this:
where it would appear as though instead of "press any key to continue" it has said the (something).
But in my code:
it says, "stop is not recoognised as a internal or external command, operation or batch file."
Could someone show me how to get this to work?
Regards,
Rileyh
Code: Select all
pause >nul
echo (something)
where it would appear as though instead of "press any key to continue" it has said the (something).
But in my code:
Code: Select all
:break
REM Stop:
REM Stop /message=
set "$file=test.txt"
set "$match=stop /message="
for /f "tokens=1-26" %%a in ('findstr /b /i "!$match!" "!$file!"') do (
set "b=%%a"
set "rest=!b:*$match=!"
set "pause=pause"
!pause! >nul
set "message=!rest!"
!message!
goto :break
)
:break
it says, "stop is not recoognised as a internal or external command, operation or batch file."
Could someone show me how to get this to work?
Regards,
Rileyh