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.
Kitroop.
"Ken Blake, MVP" wrote:
> On Mon, 30 Jul 2007 22:28:00 -0700, Kitroop
> wrote:
>
> > I am trying to use if exist/if not exist in a batch file in Win XP to test
> > for the presence of files in a directory. However, it is not working, showing
> > that files exist even if the directory is empty. Am I dong anything wrong?
>
>
> Probably. But it's hard to know what without seeing what you're doing.
> Post the batch file here.
>
> --
> Ken Blake, Microsoft MVP Windows - Shell/User
> Please Reply to the Newsgroup
> >> Stay informed about: If exist batch command not working in WinXp