Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to use isfile

Oct
19
0
How can I use isfile within a .btm file to check for the existence of another file and branch to true or false alternative logics?
 
> How can I use isfile within a .btm file to check for the existence of another file and branch to true or false alternative logics?

Here are a couple of examples.

echo Test file > NewFileName.TXT
if ISFILE NewFileName.TXT (
echo Test case 1 exists
) else (
echo Text case 1 does not exist
)
if ISFILE DoesNotExist goto itexists
echo Test case 2 does not exist
quit

:itexists
echo Test case 2 exists
quit



--
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
Measure wealth by the things you have for which you would not take money.
 
JP Software Forums" <[email protected]>; "Jim Cook wrote:
| ---Quote---
|| How can I use isfile within a .btm file to check for the existence
|| of another file and branch to true or false alternative logics?
| ---End Quote---
| Here are a couple of examples.
|
| echo Test file > NewFileName.TXT
| if ISFILE NewFileName.TXT (
| echo Test case 1 exists
| ) else (
| echo Text case 1 does not exist
| )
| if ISFILE DoesNotExist goto itexists
| echo Test case 2 does not exist
| quit
|
| :itexists
| echo Test case 2 exists
| quit

My preference is IFF / ELSE / ENDIFF:

iff isfile whatever.file then
.. process whatever.file
else
echo whatever.file does not exist
endiff

--
Steve
 
Back
Top