Reputation: 191
This is a strange problem I am facing today. Yesterday, I logged into Windows VM and tried running a simple batch script which deletes an exe if it exists.
IF Exist "C:\Temp\installer.exe" del installer.exe
It worked fine yesterday. Today, I came and logged in as same user and tried executing this batch script, it says "Access is denied." I tried with most of the switches like /f, /Q but of no use. And moreover when I tried deleting it manually, it required admin rights today. But yesterday, I could delete the same exe 100 of times using that simple script. Could anyone explain this strange behavior and the solution to this.
Thanks. Kriti
Upvotes: 0
Views: 1648
Reputation: 41234
I suspect you mistakenly launched the executable and it was running - hence the 'access denied'.
Upvotes: 0
Reputation: 1142
I know a solution that often works: take ownership
I don't know how this happens but this might solve your problem for now!
Upvotes: 1