notalot (13th May 2009)
Ok I'm sure I’m being thick but I can’t get this to work correctly its always putting out a true value even though the variable is wrong and I haven't a clue why
The text output is just for testing. Whenever you look in the text file it has always ran runsophos even if you have put N inset Sophos=
set /P Sophos=To run Sophos type Y otherwise type N: %=%
if /i "%sophos%" ==Y goto RunSophos
ELSE goto SkipSophos
Echo "Fail" >>c:\test
:Runsophos
Echo "run" >>c:\test.txt
Echo "%sophos%" >>c:\test.txt
goto EndSohpos
:SkipSophos
echo "skip" >>c:\test.txt
Echo "%sophos%" >>c:\test.txt
goto EndSophos
:EndSophos
echo "end" >>c:\test.txt
Any help would be appreciated
Works for me - sorry, didn't have time to rejig yours but that should be apparent what's what.Code:set /p sophos=Enter Y or N echo %Sophos% pause if /i %sophos% EQU y (goto moo) else (goto boo) :moo echo moo goto endbat :boo echo boo goto endbat :endbat echo done pause
notalot (13th May 2009)
thanks for that
There are currently 1 users browsing this thread. (0 members and 1 guests)