I have written a batch file to assist a local mom-and-pop shop automate a data gathering process. It goes as below:
Code:
@echo off
:Top
cls
if not exist c:\data\inventory.bat goto wait
move c:\data\inventory.bat c:\temp\inventory.bat
call c:\temp\inventory.bat
:wait
timeout 1800
goto top
Inside the batch file is archiving command(s) to add to an existing archive which is stored offline at the end of business each day.
He's my question: What happens if the 'move' command happens at the same instant that the original batch file is open for a write operation?
I suspect this would raise some sort of error. I know a tiny bit about 'errorlevel' statements. This one, I am not sure how to handle.