Sysinternals tools: Handle, Process Monitor, Autoruns and TCPView

The built-in tools tell you a lot, but now and then you need to see exactly which file a program opens, what starts at boot or who’s holding a lock. The Sysinternals tools from Microsoft show you all of that, which is why senior admins keep a copy on every jump box.

You’ll download the Sysinternals Suite, find out who has a file open, trace file and registry activity with Process Monitor, list everything that starts automatically with Autoruns and see network connections for each process. Then you’ll put them to work on a locked file and a script that fails without a word.

TimeYou needBy the end you can
About 75 minutesSRV01 with internet access for one downloadUse Handle, Process Monitor, Autoruns and TCPView to answer questions the built-in tools can’t

What it is, in one line

Sysinternals is Microsoft’s collection of small diagnostic tools that show what Windows is really doing with processes, handles, file and registry activity, autostart entries and network connections.

In Simple Words

In Simple Words

Task Manager is like looking at a house from the street, where you can see which lights are on. Sysinternals tools are like walking inside with a torch: you see which taps are running, which doors are locked and who has the keys, and you can watch every door open and close for a few minutes. You won’t need the torch every day, but when something strange happens and the view from outside doesn’t explain it, it saves you hours.

Engineer's View

Engineer’s View

Process Explorer: a deeper Task Manager. It shows the process tree, DLLs, handles, threads with stacks, and can check files against VirusTotal. Find > Find Handle or DLL answers “who has this file open?”

Process Monitor (Procmon): records file system, registry, network and process events as they happen, along with the result of each one (SUCCESS, ACCESS DENIED, NAME NOT FOUND). Filters keep the capture readable, and a backing file stops it from filling up memory.

Autoruns: lists every place something can start automatically, from services and drivers to scheduled tasks, Run keys, Winlogon and WMI. autorunsc -m hides the Microsoft-signed entries so the unusual ones jump out.

TCPView and tcpvcon: network connections by process.

Handle: open handles from the command line. Sigcheck: file versions and signatures.

RAMMap: where physical memory goes. PsTools: remote process and system information.

Getting them: download the Sysinternals Suite from download.sysinternals.com, or run the tools straight from live.sysinternals.com. For scripts, most command-line tools accept -accepteula and -nobanner.

How it works, step by step

Which tool answers which question:

Sysinternals tools: Handle, Process Monitor, Autoruns and TCPView by question

Start with the question and not the tool. “Who locks this file?” is a job for Handle or Process Explorer, “What is this program trying to read?” is Process Monitor, and “Why does this start at boot?” is Autoruns.

Process Monitor is the most powerful tool here and also the noisiest, so set a filter on the process name before you start, reproduce the problem once, and stop the capture.

Run the tools as administrator, because most of what they show (other users’ processes, kernel handles) needs it.

How to read a Process Monitor result:

Sysinternals Process Monitor results: SUCCESS, NAME NOT FOUND and ACCESS DENIED

You’ll do the whole lab on SRV01:

  • Download and unpack the Sysinternals Suite.
  • Find which process has a file open with Handle.
  • Trace a command with Process Monitor and export the result.
  • List non-Microsoft autostart entries with Autoruns.
  • See network connections per process with tcpvcon.

Hands-on lab: see what Windows is doing

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Start DC01 and SRV01, and work on SRV01 as SAATLAB\adm.rahul in PowerShell as administrator.

1Download the Sysinternals Suite

On SRV01:

New-Item C:\Tools -ItemType Directory -Force | Out-Null
Invoke-WebRequest https://download.sysinternals.com/files/SysinternalsSuite.zip -OutFile C:\Tools\SysinternalsSuite.zip
Expand-Archive C:\Tools\SysinternalsSuite.zip -DestinationPath C:\Tools\Sysinternals -Force
$env:Path += ';C:\Tools\Sysinternals'
Get-ChildItem C:\Tools\Sysinternals\*64.exe | Measure-Object | Select-Object Count

You’ll see something like this:

Count
-----
   74

Most tools in the suite come in 32-bit and 64-bit versions, and on a 64-bit server you use the ones ending in 64. Adding the folder to the path means you can run them by name for the rest of this session.

✅ Checkpoint: C:\Tools\Sysinternals holds the tools and you can run them by name.

2Find who has a file open

Open a file in Notepad, and then look for it with Handle:

'test' | Set-Content C:\Lab\report.txt
Start-Process notepad.exe C:\Lab\report.txt
handle64.exe -accepteula -nobanner C:\Lab

You’ll see something like this:

powershell.exe     pid: 4120   type: File           44: C:\Lab
notepad.exe        pid: 5236   type: File           1C4: C:\Lab

Handle lists every process holding a handle to anything under that path, which here means your PowerShell session (its current folder) and Notepad. On a file server the same search tells you which process or service is holding a file that users can’t replace. Close Notepad when you’ve finished.

✅ Checkpoint: Handle shows the process name and PID holding handles under C:\Lab.

Sysinternals lab: Handle shows which process has files open
Sysinternals Handle: which process holds handles under a folder

3Trace a command with Process Monitor

Start a capture to a file, run a command, stop the capture and export it to CSV:

Procmon64.exe /AcceptEula /Quiet /Minimized /BackingFile C:\Lab\trace.pml
Start-Sleep -Seconds 5
cmd /c "type C:\Lab\missing-file.txt"
Procmon64.exe /Terminate
Procmon64.exe /OpenLog C:\Lab\trace.pml /SaveAs C:\Lab\trace.csv
Import-Csv C:\Lab\trace.csv |
    Where-Object { $_.'Process Name' -eq 'cmd.exe' -and $_.Path -like '*missing-file*' } |
    Select-Object 'Process Name', Operation, Path, Result -First 2 | Format-Table -Wrap

You’ll see something like this:

Process Name Operation  Path                    Result
------------ ---------  ----                    ------
cmd.exe      CreateFile C:\Lab\missing-file.txt NAME NOT FOUND

Every file and registry access is recorded along with its result: NAME NOT FOUND means the file or key doesn’t exist, ACCESS DENIED is a permissions problem, and SUCCESS means it worked. In the Procmon window you get the same view with Filter, then Process Name is cmd.exe. [Add your screenshot here]

✅ Checkpoint: C:\Lab\trace.csv shows cmd.exe getting NAME NOT FOUND for missing-file.txt.

4List non-Microsoft autostart entries

On SRV01:

autorunsc64.exe -accepteula -nobanner -a * -c -m -s > C:\Lab\autoruns.csv
Import-Csv C:\Lab\autoruns.csv | Where-Object Entry |
    Select-Object Category, Entry, Signer -First 5 | Format-Table

You’ll see something like this:

Category        Entry                        Signer
--------        -----                        ------
Services        VBoxService                  (Verified) Oracle America, Inc.
Drivers         VBoxGuest                    (Verified) Oracle America, Inc.
Drivers         VBoxSF                       (Verified) Oracle America, Inc.
Drivers         VBoxWddm                     (Verified) Oracle America, Inc.

With the Microsoft entries hidden, only third-party software is left, which here means the VirtualBox Guest Additions and whatever else you’ve installed, so your list will differ. On a real server, an unsigned entry or one from a company you don’t know deserves a closer look.

✅ Checkpoint: C:\Lab\autoruns.csv lists non-Microsoft autostart entries with their signers.

5See network connections per process

On SRV01:

tcpvcon64.exe -accepteula -nobanner -c -n | ConvertFrom-Csv -Header Proto, Process, PID, State, Local, Remote |
    Where-Object State -eq 'ESTABLISHED' | Select-Object -First 4 | Format-Table

You’ll see something like this:

Proto Process      PID State       Local           Remote
----- -------      --- -----       -----           ------
TCP   lsass.exe    792 ESTABLISHED 10.0.0.20:49702 10.0.0.10:389
TCP   svchost.exe 1436 ESTABLISHED 10.0.0.20:49688 10.0.0.10:135
TCP   System         4 ESTABLISHED 10.0.0.20:445   10.0.0.150:50214
TCP   dfsrs.exe   2980 ESTABLISHED 10.0.0.20:49711 10.0.0.11:49673

Each connection shows the process behind it: lsass talking LDAP to DC01, SMB from CL01 and DFS Replication to DC02. When the firewall team asks “what is this server talking to on port X?”, this one command gives them the answer.

✅ Checkpoint: tcpvcon lists established connections with the owning process.

Break It, Then Fix It

Two mysteries you’ll meet all the time: a file you can’t delete, and a script that does nothing and tells you nothing.

1Break it: a locked file

Open a second PowerShell window on SRV01, open a file in it and keep it open:

$fs = [System.IO.File]::Open('C:\Lab\report.txt', 'Open', 'ReadWrite', 'None')

Back in your first window, try to delete that file:

Remove-Item C:\Lab\report.txt

You’ll see something like this:

Remove-Item : Cannot remove item C:\Lab\report.txt: The process cannot access the file 'C:\Lab\report.txt'
because it is being used by another process.

The error mentions “another process” but doesn’t say which one, and on a busy server that could be a backup agent, antivirus, a user’s session or a service.

To fix it, find who’s holding it and then close it properly:

handle64.exe -accepteula -nobanner C:\Lab\report.txt

You’ll see something like this:

powershell.exe     pid: 6012   type: File           2A8: C:\Lab\report.txt

PID 6012 is your second window. Close the file there with $fs.Close(), run Remove-Item C:\Lab\report.txt again and this time it works. Handle can force a handle closed with -c, but that can crash the program, so whenever you can, stop the owning service or application instead.

✅ Checkpoint: Remove-Item failed while the file was open, Handle named the process, and the delete worked after closing it.

2Break it: a script that fails silently

On SRV01, create a folder that only administrators can write to, plus a script that logs into it but hides its errors:

New-Item C:\Lab\Secure -ItemType Directory -Force | Out-Null
icacls C:\Lab\Secure /inheritance:r /grant 'Administrators:(OI)(CI)F' 'SYSTEM:(OI)(CI)F'
Set-Content C:\Lab\nightly.cmd '@echo %date% %time% >> C:\Lab\Secure\run.log 2>nul'

Now sign in at the SRV01 console as SAATLAB\sneha.reddy and run C:\Lab\nightly.cmd. Nothing shows on screen, and when you check as adm.rahul you’ll find C:\Lab\Secure\run.log was never created.

To trace it, start Procmon as adm.rahul, ask Sneha to run the script again, and then check the result:

Procmon64.exe /AcceptEula /Quiet /Minimized /BackingFile C:\Lab\silent.pml
# Sneha runs C:\Lab\nightly.cmd now
Procmon64.exe /Terminate
Procmon64.exe /OpenLog C:\Lab\silent.pml /SaveAs C:\Lab\silent.csv
Import-Csv C:\Lab\silent.csv | Where-Object { $_.Path -like '*Secure*' -and $_.Result -ne 'SUCCESS' } |
    Select-Object 'Process Name', Operation, Path, Result -First 1 | Format-Table -Wrap

You’ll see something like this:

Process Name Operation  Path                  Result
------------ ---------  ----                  ------
cmd.exe      CreateFile C:\Lab\Secure\run.log ACCESS DENIED
Sysinternals break lab: Process Monitor reveals a hidden ACCESS DENIED
Process Monitor shows the ACCESS DENIED that the script hid

The 2>nul hid the error, but Process Monitor still saw the attempt and its result. This is how you find permission problems in vendor apps that never show a useful message.

To fix it, give GG_IT modify rights on the folder:

icacls C:\Lab\Secure /grant 'SAATLAB\GG_IT:(OI)(CI)M'

Sneha signs out and back in and runs the script, and this time run.log gets a line with the date and time.

✅ Checkpoint: Procmon showed ACCESS DENIED on run.log, and the script works after granting GG_IT modify.

This happened at work

The disk that kept filling up

A file server’s C: drive kept filling up every few days. Cleanup freed 20 GB, and three days later it was full again, yet Explorer showed nothing big and nobody had installed anything new. In the end an admin ran Process Monitor for two minutes with a filter on WriteFile operations, and one process stood out straight away: a backup agent writing to a debug log under C:\ProgramData several times a second. A vendor engineer had switched on verbose logging during a support case six months earlier and never switched it off, and the log had grown to 90 GB in a hidden folder that Explorer doesn’t show by default.

The fix: the debug logging was switched off and the log deleted, and a monthly check now lists the largest files on C: on every server.

The lesson: when something keeps changing and you can’t see why, watch the activity instead of the end result, because Process Monitor shows you who is writing what.

Common mistakes and troubleshooting

MistakeWhat happensWhat to do instead
Running Procmon without filters for a long timeHuge capture, slow serverFilter first, use a backing file, capture briefly
Forcing handles closed with handle -cThe program can crash or corrupt dataStop the owning service or app
Deleting Autoruns entries you don’t recogniseSomething important stops workingResearch first; untick (disable) before deleting
Running tools without admin rightsHalf the information is missingRun as administrator
Downloading tools from random sitesRisk of tampered binariesUse download.sysinternals.com or live.sysinternals.com
Leaving Procmon runningMemory and disk use growStop with /Terminate when done
Ignoring signer informationUnsigned or unknown entries missedUse -s and review unsigned entries
Forgetting to accept the EULA in scriptsScripts hang on a dialogAdd -accepteula (or /AcceptEula)

Interview questions

Click a question to open it. Each one is worded the way an interviewer would ask it, and underneath you’ll see why they ask and one way you could answer in your own words.

Fresher level

1. Have you used the Sysinternals tools? Which ones would you mention first?

Why they ask this: They’re checking you know the common diagnostic tools most Windows admins rely on.

How you might answer: Sysinternals is a set of diagnostic tools from Microsoft, and the ones I use most are Process Explorer, Process Monitor, Autoruns, TCPView and Handle. They show what Windows is doing under the hood, which the normal tools often can’t.

2. A user can’t delete a file because it’s “open in another program”. How would you find which process has it?

Why they ask this: They want to see you can sort out this very common problem quickly.

How you might answer: I’d use Find Handle in Process Explorer, or run handle64 with the file path, and both show which process has the file open. Then I’d close that app or stop the service properly instead of forcing the handle closed.

3. What does Autoruns show you, and when would you open it?

Why they ask this: They want to know you understand all the places Windows starts things from automatically.

How you might answer: Autoruns shows everything that’s set to start automatically, like services, drivers, scheduled tasks, Run keys and Winlogon entries. I open it when a server boots slowly or when I suspect something unwanted is starting.

2–5 years experience

4. An application fails, but the error message tells you nothing useful. How would you troubleshoot it?

Why they ask this: They want to see you know how to use Process Monitor to find causes nobody can see.

How you might answer: I’d run Process Monitor with a filter on that app, reproduce the problem once and stop the capture. Then I look for results like ACCESS DENIED or NAME NOT FOUND on files and registry keys, and that usually points straight to a missing permission or file.

5. Process Monitor captures millions of events in a minute. How do you keep a capture manageable?

Why they ask this: They want to see you use the tool well without overloading the server.

How you might answer: I set a filter on the process before I start capturing, use a backing file instead of memory and only capture while I’m reproducing the problem. I also turn on the option to drop filtered events, so the capture stays small.

6. The security team thinks a server might have malware set to start automatically. How would you check?

Why they ask this: They want to see you can use these tools with a security mindset.

How you might answer: I’d run autorunsc with -m to hide Microsoft entries, -s to verify signatures and -h to show hashes. Then I’d look hard at anything unsigned or unknown and check those hashes against our threat tools.

Senior level

7. You need the same Sysinternals check on 100 servers. How would you do it?

Why they ask this: They want to see you can turn a one-server tool into something that works at scale.

How you might answer: I’d run the command-line versions remotely with Invoke-Command, save the output as CSV and collect all the files in one place. Then I’d compare them against a known-good baseline so the odd servers stand out.

8. When would you use Process Monitor boot logging?

Why they ask this: They want to know you’re familiar with the advanced features for hard startup problems.

How you might answer: I’d use it for problems during startup or logon, like a slow boot or a service that fails before I can even sign in. Boot logging records from very early in startup, so after the next restart I can see what happened.

9. Your manager is nervous about running these tools on production servers. What risks would you mention, and how would you reduce them?

Why they ask this: They want to see you can weigh what a tool gives you against the risk of using it.

How you might answer: Captures add overhead, force-closing a handle can crash an app, and traces can hold sensitive data. So I use filters and short captures, I don’t force-close handles on critical apps, and I store the output securely and delete it when I’m finished.

Quick quiz

Q1. Which tool records file and registry activity live?

  1. Autoruns
  2. Process Monitor
  3. TCPView
Show answer

B — It shows each result.

Q2. What does NAME NOT FOUND mean in Procmon?

  1. Permission problem
  2. The file or key doesn’t exist
  3. Success
Show answer

B — ACCESS DENIED is permissions.

Q3. Which switch hides Microsoft entries in autorunsc?

  1. -m
  2. -c
  3. -h
Show answer

A — -s verifies signatures.

Q4. Why is handle -c risky?

  1. It’s slow
  2. Closing a handle can crash the program
  3. It needs internet
Show answer

B — Stop the owner instead.

Q5. In the work story, what filled the disk?

  1. Windows updates
  2. A debug log left on by a vendor
  3. Shadow copies
Show answer

B — Procmon showed the writes.

Quick recap

  • Sysinternals tools show you what Windows is really doing.
  • Handle and Process Explorer find who has a file open.
  • Process Monitor records file and registry activity with results like ACCESS DENIED.
  • Autoruns lists every autostart location, and hiding the Microsoft entries makes the unusual ones easy to spot.
  • tcpvcon maps network connections to processes.

Next lesson

Lesson 53: Final project → Next you’ll build a small company network from scratch and then fix ten broken scenarios using everything from this course.

Further reading: Sysinternals

Want to go deeper into Sysinternals? Microsoft’s Sysinternals home page lists every tool, and the Process Monitor page describes its features. You can also see the full plan for this course on the Windows Server Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.