Hi,
I am an XP user and trying to find out which service or process uses which file. Is there any cmd command or other way to learn this.
Hi,
I am an XP user and trying to find out which service or process uses which file. Is there any cmd command or other way to learn this.
Good to see got it working with 's SIW recommendation. For anyone arriving later who wants a command-line or server-side approach (or a repeatable troubleshooting flow), here is a short, practical checklist with exact commands and safety notes.
To find which process has a file open (command line): use Sysinternals Handle. Run an elevated prompt and search by file name or path:
handle.exe "C:\path\to\lockedfile.ext" Handle prints process name, PID and the handle value. If you must forcibly close a handle (risky), use:
handle.exe -p <PID> -c <handleHex> -y Always try to stop the app/service first—closing handles can cause instability or data loss. Handle (Sysinternals). (learn.microsoft.com)
When the lock is intermittent (antivirus, indexer, background service) capture activity with Process Monitor and filter on the file/folder path and filesystem operations (CreateFile/ReadFile/WriteFile). Start capture, reproduce the problem, stop capture, then inspect the Process column to find the culprit. Process Monitor (ProcMon). (learn.microsoft.com)
Mapping services and server-side locks: get a service PID with sc queryex <ServiceName>, list services hosted by a process with tasklist /svc, and find processes using a DLL with tasklist /m <dllname>. For SMB/shared-file locks on a file server use net file or openfiles /query (note: openfiles /local on must be enabled and the machine rebooted to track local handles). Example commands:
sc queryex Spooler
tasklist /svc
tasklist /m some.dll
net file
openfiles /query See Microsoft docs for sc, tasklist, and openfiles. (learn.microsoft.com)
Recommended safe workflow: 1) close the app; 2) stop the service gracefully (net stop/Services.msc); 3) re-run Handle/ProcMon to confirm; 4) if still locked, reboot to Safe Mode or schedule deletion on boot. Check antivirus/indexing as common culprits before forcible handle-closing. Thanks to and for the GUI/process pointers — pick the tool (GUI vs CLI) that matches comfort and the need to script or automate.
Jump to Post— Member #356299I would check out process library.
There is also a link on Lifehacker for a tool called:
Good luck!!
Upon closer inspection....I'm guessing you're wonderin if a process is using particular file x? and if that's the case then …
I would check out process library.
There is also a link on Lifehacker for a tool called:
Good luck!!
Upon closer inspection....I'm guessing you're wonderin if a process is using particular file x? and if that's the case then my entire post is pointless, the above will tell you what each particular process is, but if for example you have a cmd.exe process updating a file, you'll only see cmd.exe and I'm sure process library will tell you it's a command line running....so I don't know if I was any help at all....Sorry.
Download SIW:
http://www.gtopala.com/siw-download.html
On the left you will see "Running Processes". Click on the process you wish to explore and it will list the file. You can also list all open files and sort by process or filename.
Get Process Explorer from Winternals. The tool for the job. It will show you the handles and dlls used by any running process.
Thank you all, I solved my problem using the software sknake recommended. I was unable to delete some files because they were used and I didn't know which process used them. Now everyhting's ok.
Thanks.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.