XP bat file problem with GOTO command

August 26, 2010 at 15:11:11
Specs: Windows XP
Below is my test file. As soon as it gets to "if %Day%==Thu goto :Thusday" line the command window closes (since today is Thusday). Please, help.
______________
set Day=%date:~0,3%
if %Day%==Mon GOTO :Monday
if %Day%==Tue GOTO :Tuesday
if %Day%==Wed goto :Wednesday
pause
if %Day%==Thu goto :Thusday
pause
if %Day%==Fri GOTO :Friday
GOTO Endo
:Monday
echo Monday here >> "C:\Documents and Settings\vnazar.DELL1\Desktop\Temp\test.txt"
:Tuesday
Echo Tuesday here >> "C:\Documents and Settings\vnazar.DELL1\Desktop\Temp\test.txt"
:Tursday
echo Tursday here > "C:\Documents and Settings\vnazar.DELL1\Desktop\Temp\test.txt"
echo It worked! >> "C:\Documents and Settings\vnazar.DELL1\Desktop\Temp\test.txt"
GOTO Endo
:Friday
Echo Friday here >> "C:\Documents and Settings\vnazar.DELL1\Desktop\Temp\test.txt"
GOTO Endo
:Endo
echo The END! >> "C:\Documents and Settings\vnazar.DELL1\Desktop\Temp\test.txt"
pause

See More: XP bat file problem with GOTO command

Report •

#1
August 26, 2010 at 15:19:54
Time for a spell check:


if %Day%==Thu goto :Thusday

Here it is spelled Thusday

:Tursday

Here it is spelled Tursday

You should probably make them both Thursday............

MIKE

http://www.skeptic.com/


Report •

#2
August 26, 2010 at 16:13:30
You should also post programming questions in the proper forum here:

http://www.computing.net/forum/prog...


Report •

#3
August 27, 2010 at 15:58:52
Thanks, I got it..., me dummy, looking too far...

Report •
Related Solutions


Ask Question