Solved IF Exists with wildcards?

Home Made
May 11, 2007 at 12:27:07
Specs: XP/2003/2000, Intel Core Duo 2.4
I have been writing a batch script that needs to check for the existence of a file and do some action, however the filenames changes daily. I was going use the IF Exist command with *.txt or whatver the extension is, but IF Exist does not support wildcards. Anyone know a way to use IF Exist with wildcards or some other mehtod?


See More: IF Exists with wildcards?

Report •


#1
May 11, 2007 at 12:33:25
✔ Best Answer
It DOES
================
C:\temp>if exist *.bat echo y
y



=====================================
If at first you don't succeed, you're about average.

M2



Report •

#2
May 11, 2007 at 14:00:53
thanks mechanix, this might work for me.. Any other ideas are still welcome..

Report •

#3
May 11, 2007 at 14:58:53
If you code is failing to brach, maybe it's some other problem. You can post your code.


=====================================
If at first you don't succeed, you're about average.

M2



Report •

Related Solutions

#4
May 11, 2007 at 15:58:53
Looks like its working. Thanks for your help!

Report •

#5
August 2, 2013 at 11:51:13
OI VEY 2007 MAY

http://www.youtube.com/watch?v=Rtkd...

=====================
M2 Golden-Triangle


Report •

#6
August 3, 2013 at 18:45:24
The powers that be are going back and marking best answers:
http://www.computing.net/answers/th...

How To Ask Questions The Smart Way


Report •

#7
August 3, 2013 at 19:42:22
@M2: what is "brach"? (ok, I'll google, but your def is probably better)

Report •

#8
August 5, 2013 at 12:52:19
nbrane,

Probably an attempt to type BRANCH while having a senior moment.
:)

=====================
M2 Golden-Triangle


Report •


Ask Question