View Single Post
Old 2018-01-17, 18:26   #1
Random Account
storm5510's Avatar
Aug 2009

32·199 Posts
Default Batch File Issue, Perhaps

I have written a batch file to assist a local mom-and-pop shop automate a data gathering process. It goes as below:

@echo off
if not exist c:\data\inventory.bat goto wait
move c:\data\inventory.bat c:\temp\inventory.bat
call c:\temp\inventory.bat
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.
storm5510 is offline   Reply With Quote