Search found 3 matches
- 18 Oct 2023 11:18
- Forum: DOS Batch Forum
- Topic: Replacing a locked file
- Replies: 3
- Views: 17362
Re: Replacing a locked file
I thought that too but it fails even after giving it 60 seconds. I forgot to mention it but this happens even when run as administrator.
- 18 Oct 2023 03:35
- Forum: DOS Batch Forum
- Topic: Replacing a locked file
- Replies: 3
- Views: 17362
Re: Replacing a locked file
I've put together a simple version of the problem I'm stuck on which hopefully makes more sense than my original explanation. In this example file.cmd cannot be renamed by file_rename.cmd even after file.cmd has exited. @echo off @cd /d "%~dp0" @title %~f0 Set countdown=5 9>&2 2>nul (call :lockAndRe...
- 17 Oct 2023 12:48
- Forum: DOS Batch Forum
- Topic: Replacing a locked file
- Replies: 3
- Views: 17362
Replacing a locked file
Hello, I've got a problem of my own making. A while back I created a bit of a monstrosity of a batch file to automate some tasks and I added this to stop multiple instances. @echo off 9>&2 2>nul (call :lockAndRestoreStdErr %* 8>>"%~f0") || ( echo Only one instance allowed - "%~f0" is already running...