Re: If exist batch command not working in WinXp

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



[Kitroop] wrote-:
Sorry for the delay.
The batch file is as follows:
~~~~
if exist c:\temp\testing\*.* goto yes
goto no
:yes
echo file exists
goto end
:no
echo file not exists
goto end
:end
~~~~
The batch file is in the dir C\temp. There are no files under dir "testing". However the output of the batch file is "file exists".

I have run the same batch file successfully on a dos pc.
Thanks for any help.


~~~~
dir /b /a-d c:\temp >nul 2>nul && GOTO yes
goto no
:yes
echo file exists
goto end
:no
echo file not exists
goto end
:end
~~~~



Good Luck, Ayush.
--
XP-Tips [Speed up menu display] :
http://www.microsoft.com/windowsxp/using/setup/tips/menu.mspx
.



Relevant Pages