Search code examples
batch-filewindows-scripting

.bat If Then Statement


I need help with writing a batch script for

if file newfile.txt exists
then  del "InDesignData.txt"
ren "newfile.txt" "InDesignData.txt"

Solution

  • if not exist newfile.txt goto skip
    del "InDesignData.txt"
    ren "newfile.txt" "InDesignData.txt"
    :skip