Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show which processes are locking files on volume #6

Open
joshdoe opened this issue Aug 31, 2016 · 4 comments
Open

Show which processes are locking files on volume #6

joshdoe opened this issue Aug 31, 2016 · 4 comments

Comments

@joshdoe
Copy link

joshdoe commented Aug 31, 2016

When a disk cannot be removed because a file is locked, currently a simple error message is shown. Other software like USB Safely Remove show which files are locked and which processes are locking them. If you can't add this functionality directly, you could call another application like DeadLock, which is also open source, or other tools like LockHunter.

@bgbennyboy
Copy link
Owner

bgbennyboy commented Aug 31, 2016

Its been requested a number of times before. I've never been able to find a windows api or working code for finding which processes are using a drive - the only solution I ever found involved installing a low level kernel driver which isn't portable. Ideally the code wouldnt require admin rights either.

Calling other programs is one possible solution but I'm not keen on it. USB Disk Eject is designed to be portable and many unlocker programs have to be installed in order to work. If it was going to call another application then I'd want to bundle it within the program and extract it and run it as required. For this - I'd need an unlocker that worked portably on Windows XP onwards and that had a licence that let me bundle it in. It'd also need to be a native executable - .net programs like Deadlock wouldn't be suitable as you cant always rely on a computer having the appropriate version of the .net framework installed.

@bgbennyboy
Copy link
Owner

Possible solution in this code, but looks like it might still require admin rights https://stackoverflow.com/questions/317071/how-do-i-find-out-which-process-is-locking-a-file-using-net/20623311#20623311

@bgbennyboy
Copy link
Owner

Might be possible to bundle this in and use it, depending on the licence http://www.nirsoft.net/utils/opened_files_view.html

@ronaldhoek
Copy link
Contributor

I'm using the following unlocker tool, which specificly has a portable version:
http://www.emptyloop.com/unlocker/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants