Process Monitor is an excellent troubleshooting tool from Windows Sysinternals that displays the files and registry keys that applications access in real-time. The results can be saved to a log file, which you can send to an expert for analyzing a problem and troubleshooting it.
Here is a guide on how to capture registry and file system accesses by applications, and generate a log file using Process Monitor for further analysis.
Use Process Monitor to Track Registry and File System Changes
Scenario: Let’s assume you’re unable to write to the HOSTS file successfully in Windows, and want to know what’s happening under the hood. Every step in the following article revolves around this sample scenario.
Step 1: Running Process Monitor & Configuring Filters
- Download Process Monitor from Windows Sysinternals site.
- Extract the zip file contents to a folder of your choice.
- Run the Process Monitor application
- Include the processes that you want to track the activity on. For this example, you want to include
Notepad.exein the (Include) Filters.
- Click Add, and click OK.
Tip: You can add multiple entries as well, in case if you want to track few more processes along with
Notepad.exe. To keep this example simpler, let’s track only
- From the Options menu, click Select Columns.
- Under “Event Details”, enable Sequence Number, and click OK.
Step 2: Capturing Events
- Open Notepad.
- Switch to Process Monitor window.
- Enable the “Capture” mode (if it’s not already ON). You can see the status of the “Capture” mode via the Process Monitor toolbar.The highlighted button above is the “Capture” button, which is currently disabled. You need to click that button (or use Ctrl + E key sequence) to enable capturing of events.
(You’ll now see the Process Monitor main window capturing registry and file events by processes in real-time, as and when they occur.)
- Cleanup the existing events list using Ctrl + X key sequence (Important) and start afresh
- Now switch to Notepad and try to reproduce the problem.
To reproduce the problem (for this example), try writing to the HOSTS file (
C:\Windows\System32\Drivers\Etc\HOSTS) and saving it. Windows offers to save the file (by showing the Save As dialog) with a different name, or in a different location.
So, what happens under the hood when you save to HOSTS file? Process Monitor shows that, exactly.
- Switch to the Process Monitor window, and turn off Capturing (Ctrl + E) as soon as you reproduce the problem.
Important: Don’t take much time to reproduce the problem after enabling capturing. Similarly, turn off capturing as soon as you finish reproducing the problem. This is to prevent Process Monitor from recording other unneeded data (which makes the analysis part more difficult). You need to do all that as quickly as you can.
Solution: The log file above tells us that Notepad encountered an
ACCESS DENIEDerror when writing to the
HOSTSfile. The solution would be to simply run Notepad elevated (right-click and choose “Run as Administrator”) to be able to write to
Step 3: Saving the Output
- In the Process Monitor window, select the File menu and click Save
- Select Native Process Monitor Format (PML), mention the output file name and Path, save the file.
- Right-click on the
Logfile.PMLfile, click Send To, and choose
Compressed (zipped) folder. This compresses the file by
~90%. Look at the graphic below. You certainly want to zip the log file before sending it to someone.
Editor’s note: I usually suggest my clients save the log with the All events option so that the diagnosis can be more accurate. If you’re going to send me a Process Monitor log, make sure you enable the All Events option when saving the log file. Also, don’t forget the compress (.zip) the log file first.
That’s it, readers. To keep the documentation simple, I’ve used the easiest example so that an end-user understands clearly how to efficiently track registry and file system events using Process Monitor & generate the log file.
One small request: If you liked this post, please share this?One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!