I'm revising a script, looking for simplifications. The script needs three files to process.
This is what its author originally wrote:
Code: Select all
If Not Exist 7z.dll Echo 7z.dll missing &Goto :EOF
If Not Exist 7zFM.exe Echo 7zFM.exe missing &Goto :EOF
If Not Exist 7zG.exe Echo 7zG.exe missing &Goto :EOF
So it's the same type of instruction just repeated and I thought of merging this into a one liner if possible.
Basically, what I'd like to achieve is: Check if file0 ... file2 all exist and continue if these files are present.
Otherwise the script should exit with a message (Required file missing).
This
Code: Select all
For /f %%f In (7z.dll 7zFM.exe 7zG.exe) Do (If Not Exist %%~f Echo Missing file, exiting...)
How would you proceed?