Anyone can run the First Look cases free, no account and no watermark. Open a First Look case →First Look cases · free, no account. Open one →

Windows Prefetch forensics: a PECmd walkthrough

Prefetch is the closest thing Windows has to a receipt that a program ran. One file per executable, a run count, the last eight run times, and a list of what it touched on the way up. PECmd turns the whole folder into a CSV in a few seconds. The hard part is reading it correctly.

What Prefetch records, and where it lives

Windows watches the first ten seconds or so of an application's launch and writes a note of which files and directories it loaded, so the next launch can be read from disk more efficiently. That note is a Prefetch file. They live in C:\Windows\Prefetch, one per executable, named after the program in upper case with a hash appended: NOTEPAD.EXE-C5670914.pf.

Each file carries:

Windows 10 and 11 compress these files, so a hex editor shows MAM at the start rather than the SCCA signature. PECmd handles the decompression; you don't need to.

$ xxd -l 32 NOTEPAD.EXE-C5670914.pf
00000000: 4d41 4d04 ee22 0000 6177 88b8 bbcb cbcb  MAM.."..aw......
00000010: bbba bbcb bddb ddbb babb dbdd ddbc 7bc7  ..............{.
The first 32 bytes of a Windows 10 Prefetch file from First Look: What Ran on This Machine. MAM plus 04 marks XPRESS Huffman compression, and the next four bytes are the uncompressed size, little-endian. The SCCA header only appears after decompression.

Parse the folder with PECmd

PECmd is one of Eric Zimmerman's free tools and needs the .NET runtime. Download it from ericzimmerman.github.io; the Tools & setup page lists it alongside the rest of the kit. One file at a time, to the console:

PECmd.exe -f "C:\evidence\Prefetch\NOTEPAD.EXE-C5670914.pf"

The whole folder, to CSV:

PECmd.exe -d "C:\evidence\Prefetch" --csv C:\out --csvf prefetch.csv

You get two files. prefetch.csv has one row per Prefetch file with the run count, the eight run times in their own columns, and the volume and file lists. prefetch_Timeline.csv flattens every run time into its own row, which is the one to drop into a timeline. Open either in Timeline Explorer, sort by the last run column, and the recent activity on the machine is on the screen in front of you.

Two flags worth knowing: --mp prints timestamps to the millisecond, which matters when you're lining up a run against a 4688 event, and -k "keyword1,keyword2" highlights any file reference that matches, so you can hunt for a document name across every Prefetch file at once.

Reading a row

Take a utility a student is asked about in First Look: What Ran on This Machine: one user profile, a downloaded tool, and the questions "was it run, how often, and when". The Prefetch row answers all three directly. The executable name is in the filename, the run count is a column, and the last run column is the most recent execution. The eight run times tell you the pattern: once at 02:14 is different from eight times across a working day.

Then read down into the references. The volume list tells you where it ran from. If the volume serial doesn't match the system drive, cross-check it against USBSTOR and MountedDevices in the SYSTEM hive; the Registry Explorer guide walks those keys. The file references often include the thing the tool operated on: an archive it compressed, a document it opened, a DLL it sideloaded. Prefetch is strongest when it points you to the next artifact.

Prefetch proves a program started. It doesn't prove who started it, what it did, or that it finished. Pair it with UserAssist, a LNK file or a process-creation event before you write "the user ran".

The misreads that cost marks

Where it fits

Prefetch sits in the execution family with UserAssist, Amcache, Shimcache and the 4688 event. On its own it answers "did this start, and when". With a LNK file or a jump list it answers "and what did they open with it". With event logs it answers "under which account". The EvtxECmd guide covers that last pivot. In Red Herrings, Windows cases ship real .pf files, written with the run counts and timestamps that the answer key is derived from, so PECmd reads them the same way it reads a live machine, and every student's run times and volume serials are their own. The Windows forensics pathway on the pathways page places this First Look as week two, right after the registry.

Want to practice on real evidence?

Run the free First Look cases or download the sample lab, or start the 30-day trial with sample cases to try, and generate a per-student case.