hidden hit counter
Welcome to WindowsForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

If exist batch command not working in WinXp

 
   Windows XP (Home) -> New Users RSS
Next:  Master boot disc  
Author Message
Kitroop

External


Since: Jul 30, 2007
Posts: 2



(Msg. 1) Posted: Mon Jul 30, 2007 10:28 pm
Post subject: If exist batch command not working in WinXp
Archived from groups: microsoft>public>windowsxp>newusers (more info?)

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?
Any solutions ?

 >> Stay informed about: If exist batch command not working in WinXp 
Back to top
Login to vote
Ken Blake, MVP

External


Since: May 20, 2007
Posts: 877



(Msg. 2) Posted: Tue Jul 31, 2007 8:01 am
Post subject: Re: If exist batch command not working in WinXp [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 
Back to top
Login to vote
Kitroop

External


Since: Jul 30, 2007
Posts: 2



(Msg. 3) Posted: Thu Aug 02, 2007 4:10 am
Post subject: Re: If exist batch command not working in WinXp [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 
Back to top
Login to vote
Ken Blake, MVP

External


Since: May 20, 2007
Posts: 877



(Msg. 4) Posted: Fri Aug 03, 2007 8:23 am
Post subject: Re: If exist batch command not working in WinXp [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 3 Aug 2007 07:25:53 -0400, Stan Brown
wrote:


> Note -- in XP use "*" for wildcards. "*.*" is okay but sooooo 1980s.
> Smile



The * always worked instead of *.*, even in the 1980s.

--
Ken Blake, Microsoft MVP Windows - Shell/User
Please Reply to the Newsgroup
 >> Stay informed about: If exist batch command not working in WinXp 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Problem with batch file for backup using xcopy - I have set up a batch file to backup my documents, mail and desktops. xcopy e:\robindox t:\robindox /s /d /y /i /k /h /w /EXCLUDE:c:\a.txt xcopy e:\transdox t:\transdox /s /d /y /k /i /h /EXCLUDE:c:\a.txt xcopy m:\eudora t:\eudora /s /d /y /k /i xcopy....

What does this command mean - Start>Run> temp or Start>Run> %temp% Working on a Symantec program and they said to do above (couldn't tell in script if they were using percent signs or not....vision problem for me). They said to run that program, hit select all and the...

command promt - help please i keep getting black box pop up saying C/windows system32\wscntfy.exe 16 bit ms-dos subsystem tvdmcpu has encountered an illegal instruction cs of8bip:01fbop:636c617373 choose close to terminate application how do i switch off..

Command Prompt Error - Hi! I run a Windows XP and whenever I try to run my command prompt window I get an error saying that the system file is not suitable for running MS-DOS and Microsoft Windows apllications. How do I fix this? Thanks.

remote control via command line - How many ways available to run a remote command on XP? Where can I find the resources? What is the best way?
   Windows XP (Home) -> New Users All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
  Windows XP
 Win 2000/NT/98/ME
 Windows Vista!


[ Contact us | Terms of Service/Privacy Policy ]