I need help with writing a batch script for
if file newfile.txt exists
then del "InDesignData.txt" ren "newfile.txt" "InDesignData.txt"
Thanks in advance, Joe
(SOLVED) .bat If Then statement
Moderator: DosItHelp
(SOLVED) .bat If Then statement
Last edited by jmituzas on 31 Aug 2010 11:34, edited 1 time in total.
Re: .bat If Then statement
Solved
if not exist newfile.txt goto skip
del "InDesignData.txt"
ren "newfile.txt" "InDesignData.txt"
:skip
if not exist newfile.txt goto skip
del "InDesignData.txt"
ren "newfile.txt" "InDesignData.txt"
:skip
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: (SOLVED) .bat If Then statement
You could also,
or,
Code: Select all
if exist newfile.txt (
del "InDesignData.txt"
ren "newfile.txt" "InDesignData.txt"
)
or,
Code: Select all
if exist newfile.txt del "InDesignData.txt"&&ren "newfile.txt" "InDesignData.txt"