eg. I want to run a Windows batch file, say upgrade.bat, which copies a bunch of files from the source directory to the directory where the batch file is located. The problem is that one of the copied files may be a newer version of the update. bat, so the batch file will overwrite itself while it is still running.
This seems to lead to some unpredictable batch file execution behavior, so I want to avoid copying over the batch file, which still works. Ideally, I want the existing version of upgrade.bat to run until it is complete, and next time launch the new version. Are there (simple) ways to achieve this?
batch-file
Moe sisko
source share