Windows 7 seems to locks cmd files after execution.
I was not able to reproduce this on other windows 7 machines but for some reason if I execute a cmd file I can't edit the file after execution. It tells me the file is locked by another process. I used Unlocker and it says that the System process has it locked. If I wait like 5 mins or so it will release but it's really, really annoying. Does anyone know why the system would be holding on to the cmd file after execution completed? Thanks, Jeff Sessions
March 25th, 2010 7:37pm

Jeff, could it have something to do with the command you are using inside the cmd file, or does this happen with any cmd file?Rich Why can't I be different and original like everybody else? - Vivian Stanshal
Free Windows Admin Tool Kit Click here and download it now
March 26th, 2010 1:23am

I suggest you boot in Clean Boot Mode to troubleshoot. Perform a clean startup to determine whether background programs are interfering with your game or programArthur Xie - MSFT
March 26th, 2010 10:58am

No. It happens when I just create a command file with a pause in it. Also, I just noticed that visual studio 2010 is doing something similar. If I debug a project then press stop in the debugger I can't build or start a debugging again because it says the files are in use. However, it does not happen when I close the debugging application. Thanks, Jeff
Free Windows Admin Tool Kit Click here and download it now
March 26th, 2010 10:32pm

Maybe the process paused but does not resume. Therefore the process still works and you cannot edit the file.Arthur Xie - MSFT
March 30th, 2010 11:57am

Hi Jeff! I have exactly the same problem with win7/64. Did you find out anything how to get rid of this effect ? Thank you very much. Jochen
Free Windows Admin Tool Kit Click here and download it now
April 26th, 2010 12:30pm

Sorry, I have not found a workaround for this yet. What seems to work faster is coping the file then deleting the original and renaming the copy. It's just about the ugliest hack ever but it faster than waiting 3 to 5 mins for the process to release. Jeff
May 25th, 2010 6:13pm

Just a little bump and add some information. If I run in clean boot mode it still happens, but if I run in safe mode it does not. This problem is really annoying.
Free Windows Admin Tool Kit Click here and download it now
September 15th, 2010 3:40pm

hi i have the same trouble; the release compile/run seems to lock even further, file cannot be deleted. the debug compile/run at least lets me delete the exe afterward the debug session, so i can recompile faster.... process explorer doesnt show the file/process anymore. i have latest MSE as virus scanner. any known solution to this? im running windows7-64bit as well.
November 29th, 2010 10:24am

I have the same issue. I run .cmd file and after it can be deleted. The simplest way to reproduce it: 1. Run .cmd file 2. Force to stop it (press Ctrl-C before execution will have been finished). 3. Try to delete .cmd file. PS In my case java process starts in .cmd.
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2011 8:17am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics