How can I find out which process is locking a file or folder in Windows? For instance, when trying to delete a folder, Windows reports this: The action can't be.
Preset viewer seriale. I recently installed CodeBlocks with mingw32 on Windows 7 Ultimate 32bit in order to dust off my c skills, but this problem has me somewhat stumped.
I decided to fire off a short Fibonacci generator to make sure my setup was working, but I ran into a hurdle.
The program compiles, links and whatnot like a charm and I get a corresponding executable which runs as expected.
The problems occur if I try to compile again, then I get the following:
I can't even edit the permissions of the generated executable.
I've checked the usual suspects:
And now for the funny bit: Usually after a few minutes, any executables generated by mingw32 which are displaying this Access Denied behaviour will automatically vanish without any intervention from me.
I've googled this somewhat, but most of the other results were either vague or inapplicable.
I wonder whether there is some Windows 7 security setting playing havoc with my .exe's, but I'm not that knowledgeable about Win 7 as to know where to begin searching.
Any one have any ideas?
I had exactly the same problem right after switching off some (in my opinion unneccessary) Windows services. It turned out that when I switched ON again the 'Application Experience' everything resumed working fine.
May be you simply have to turn on this service? To switch ON Application Experience:
Click the Windows start buttonn.
In the box labeled 'Search programs and files' type services.msc and click the search button. A new window with title 'Services' opens.
Right click on 'Application Experience' line and select 'Properties' from popup menu.
Change Startup type to 'Automatic (delayed start)'.
Restart computer.
Application Experiences should prevent the problem in the future.
If you think the executable is locked by a process, try Process Explorer from SysInternals. In the File/handle, enter Fibonacci.exe and you should see who holds the file.
If it is not enough, you can use Process Monitor (from SysInternals, again) to follow the activity of all processes on your system on Fibonacci.exe.With a little bit of analysis (call stacks), you'll may find out why the access to the file is denied and what make it disappear.
Your program is still running. You have to kill it by closing the command line window.If you press control alt delete, task manager, process`s (kill the ones that match your filename).
The Best solution is go to console in eclipse IDE and click the red button to terminate the program.You will see the your program is running and output can be seen there. :) !!
Open task manager -> Processes -> Click on .exe (Fibonacci.exe) -> End Process
if it doesn't work
Close eclipse IDE (or whatever IDE you use) and repeat step 1.
I had the same behaviour, and fixed it by running Code::Blocks as administrator.
I had a similar problem. Using a freeware utility called Unlocker (version 1.9.2), I found that my antivirus software (Panda free) had left a hanging lock on the executable file even though it didn't detect any threat. Unlocker was able to unlock it.
Got the same issue. Read this. Disabled the antivirus software (mcaffee). Et voila
Confirmed by the antivirus log:
Blocked by Access Protection rule d:mingw64x86_64-w64-mingw32binld.exe d:workspacecppbarfoo.exe User-defined Rules:ctx3 Action blocked : Create
In my case Malwarebytes was holding a handle on my program's executable:
Using Process Explorer to close the handle, or just disabling antivirus for a bit work just fine.
Problem Cause :The process of the current program is still running without interuption.(This is the reason why you haven't got this issue after a restart)
The fix is simple :Go to cmd and type the command taskkill -im process-name.exe -f
Eg:
here,
demo - is my program name
I got this error when using the Atom editor and mingw (through a package called gpp-compiler) for C++. Closing the open console window fixed my issue.
i experienced a similar issue. Bitdefender automatically quarantined each exe-file i created by MinGW g++. Instead of the full exe-file i found a file with a weird extension 'qzquar'testAutoPtr1.exe.48352.gzquar
When i opened quarantined items in Bitdefender i found my exe-file quarantined there.
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Ok, so when I try to delete this from my desktop, I get this error:
When I click 'See what's locking this' in lock hunter, I get this:
Now, I have a drive, called G:. I only have one physical drive, and it's D:. Also, I have NO virtual drive software installed, so I have NO clue how it got there. Right-clicking on G: and chosing eject doesn't do anything but change the logo, it still says the file size and whatnot. Here's the picture of the 'What's locking this?' of the contained file:
But when I try to delete it..
Both of these files don't let me delete them. I had put win8install.iso as a virtual drive a while back, but I uninstalled that software (but can reinstall it if needed)
Starting this in safe mode doesn't work.
Get a Linux Live Cd, and get gparted, systemrescue or parted magic (any release would work, but a small distro for something quick). Burn it to cd/usb, and boot your computer to it. Mount the hd, and find the folder and delete it.
You can use Unetbootin to create the live cd or do it manually.
Use Process Explorer to identify which process is keeping an open handle to the file.
Find > Find Handle or DLL..win8image.isoSearchThen make the program close its handle. In your case the issue might be that the ISO image is still connected to a virtual machine or a virtual drive.
Take ownership of the ISO file and then delete it. This happens sometimes on my Win7 x64 as well.
You may also want to consider adding this option in the right-click menu so you can take ownership of any NEW file before you start working with it.
On a side note, Unlocker now has a 64-bit version too. :)
Windows includes the ability to mark files for deletion upon reboot. This ensures the files are not in use at the time as they are deleted by the system before Windows starts completely.
An application such as this one exposes this functionality to the end user.
Edit: I would recommend MoveFile as it is from a reputable source (Thanks Ansgar).
If none software is doing the job then you can use the OLD IS GOLD formula and that is command prompt. If you want to delete the file from the running Windows then open the elevated-command prompt(command prompt window with admin rights). For this click on the start menu and then type CMD in search box and right click on the cmd.exe and then click on the option Run as Administrator.
Now open the Windows explorer and click on the Organize >Folder and Search Option.
Now unchecked the option Hide extension for known file types and click OK. And go to method 1 or 2.
a. To Use a Command Prompt at Boot
b. In the command prompt, type diskpart and press Enter.
c. In the command prompt, type list volume and press Enter.
d. After making note of the drive letter, type exit and press Enter.
Method 1
In the command prompt, type the command below and press enter.
DEL /F /S /Q /A 'Full Path of File with extension'
Example
DEL /F /S /Q /A 'C:UsersUserNameDesktopFile.txt'
File should be deleted now.
Method 2.
In the command prompt, type the command below and press enter.
DEL /F /S /Q /A 'Full Path of Folder*'
File should be deleted now.
Close the command prompt.
NOTE: If you used a command prompt at boot, then also close the System Recovery Options window and restart the computer.
For more information you can check out this Sevenforum article.
It is possible that win8install.iso is mounted as a virtual drive in Windows.
Since Windows 8, any .iso can be mounted natively without the need for third-party software.
You can find a description of the process in How to Mount or Unmount ISO images in Windows 8.
You can verify whether this is the case by calling Windows Explorer :