What a Windows prefetch file shows, and what it does not
Windows keeps a small file for each program it has run, in C:\Windows\Prefetch, to make the next launch faster. As a side effect it is one of the best records there is that a particular program ran, when, and how often. Most pages on this explain the idea; this one reads a real file.
Written · Updated
A prefetch file shows that a program ran: its name, when it last ran (the last eight times on Windows 8, 10 and 11), how many times it has run in total, every file it loaded in its first seconds, and the volumes it read from, with their serial numbers. It does not show who ran it or what they did with it. On Windows 10 and 11 the file is compressed, which is why opening it in a text or hex editor shows nothing useful. PREFETCH decompresses and reads it in your browser, on any computer, and nothing is uploaded.
Where the files are
In C:\Windows\Prefetch, one per program and path, named like CALC.EXE-3FBEF7FD.pf. The hex after the dash is a hash of the path the program ran from, so the same program run from two places has two files, and a program run from a USB stick has a different hash from the installed copy. Copying them out needs an administrator account.
Prefetching can be turned off, and Windows Server has it off by default. An empty or missing Prefetch folder on a desktop is itself worth noting.
What is in one
This is a real Windows 10 prefetch file for the Calculator, from a public forensic test set, as PREFETCH reads it:
| Field | In this file | What it means |
|---|---|---|
| Stored | 11 KB, compressed; 47 KB expanded | Windows 10 and 11 compress every prefetch file |
| Format | version 30 | Windows 10; 31 is Windows 11, 26 Windows 8, 23 Vista and 7 |
| Program | CALC.EXE | The executable's name, up to 29 characters |
| Prefetch hash | 3FBEF7FD | Matches the file name, so the file is the one it claims to be |
| Times run | 2 | A lifetime count, which can be far higher than the number of times listed |
| Run times | 11 January 2016, 22:08:20 UTC; 10 January 2016, 02:12:33 UTC | The most recent first; up to eight are kept |
| Volume | serial 8C9F-49EC, created 17 November 2015 | The disk it read from, identifiable against other evidence |
| Files loaded | 63 | NTDLL.DLL, CALC.EXE, KERNEL32.DLL and the rest, with full paths |
The paths in a Windows 10 file start with \VOLUME{01d1217a9c4c6779-8c9f49ec} rather than a drive letter. The second half of that is the volume serial, and the first half is the volume's creation time as a FILETIME, so the name and the volume record agree with each other: a small internal consistency check you can do by eye.
Reading one without installing anything
- Copy the
.pffiles you need out ofC:\Windows\Prefetch, and take a hash of each before you do anything else if the result may be relied on. CHECKSUM does that in the browser. - Open PREFETCH on any computer, including a Mac or a phone, and drop a file on it. A Windows 10 or 11 file is expanded in the tab first, and the result says so and gives both sizes.
- Read the table, the run times and the list of files. The search box filters the file list, which is the quickest way to find a document or a drive letter.
Until this page was written PREFETCH refused compressed files and told you to expand them with another tool first, which meant every file a current Windows machine writes. It also read an expanded file at the wrong offsets, so the run count and run times it showed were not the ones in the file; its only test was a file built to those same wrong offsets. It now decompresses LZXPRESS Huffman itself, to Microsoft's published specification, and reads each version at the offsets documented by libscca. Its expansion of the file above matches an independent decompressor byte for byte.
What a prefetch file does not tell you
- Who ran it. There is no user account in the file. That has to come from somewhere else, such as the user's registry hive or the Security event log.
- What it did. The list of files is what the program loaded in roughly its first ten seconds, which is often its libraries and sometimes the document it was opened with. It is not a log of everything it touched.
- Every run. The count is a total, and only the last eight times are kept. A ninth run pushes the oldest time out.
- Absence. No prefetch file does not mean the program never ran. Prefetching may be off, the file may have been deleted, and Windows keeps a limited number of them and removes the oldest.
- Exact launch time. The times are the machine's own clock, in UTC, as Windows recorded them; allow a few seconds against the moment the program was started, and check the machine's clock was right.
For the rest of what shows a USB drive was used on the same machine, see how to tell if a USB drive was plugged into a PC.
Questions people ask about What a Windows prefetch file shows, and what it does not
What does a Windows prefetch file show?
That a program ran: its name, the last time it ran (the last eight on Windows 8, 10 and 11), a lifetime run count, the files it loaded in its first seconds, and the volumes it read from with their serial numbers. It does not show who ran it.
Why can I not read a Windows 10 prefetch file in a hex editor?
Windows 10 and 11 compress every prefetch file. It starts with the letters MAM and the rest is LZXPRESS Huffman data. PREFETCH expands it in the browser and then reads it.
Where are prefetch files stored?
In C:\Windows\Prefetch, named like PROGRAM.EXE-XXXXXXXX.pf, where the hex is a hash of the path the program ran from. Copying them needs an administrator account.
Does a prefetch file show who ran a program?
No. There is no user account in it. Who ran it has to be established from other evidence, such as the user's registry or the Security event log.
How many run times does a prefetch file keep?
One on Windows XP, Vista and 7; the last eight on Windows 8, 10 and 11. The run count is a separate lifetime total, so it can be much higher than the number of times listed.
If there is no prefetch file, does that mean the program never ran?
No. Prefetching can be turned off, and is off by default on Windows Server; files can be deleted; and Windows keeps a limited number, removing the oldest.
What is the number after the dash in a prefetch file name?
A hash of the path the executable ran from. The same program run from two locations, such as a USB stick and Program Files, gets two prefetch files with different hashes.
Can I read a prefetch file on a Mac?
Yes, with PREFETCH, which runs in the browser and expands Windows 10 and 11 compressed files itself. There is nothing to install.
Related tools
- PREFETCHRead a Windows .pf: what ran, when, how often
- PLUGGEDWhich USB devices were installed, and when
- SHORTCUTWhat a .lnk file says about the file and drive it pointed at
- CHECKSUMHash a file before you rely on it
- How to tell if a USB drive was plugged into a PCThe device side of the same question
- What is this timestamp?FILETIME and sixteen other formats
- How to check a PDF for malware without uploading itEvery answer to this says upload it to VirusTotal, which shares what you upload.
- How to read a pcap file without WiresharkWhat a pcap and a pcapng actually contain, the five questions worth asking of a capture first, and how to answer them in a browser tab (conversations, DNS, the server name in a TLS handshake, credentials in the clear…
- What a browser extension can do, before you install itEvery answer tells you to read the box Chrome shows when you click Add. The extension is a zip you can download and read first, and it names the SDKs and the addresses the dialogue never mentions.
- What a QR code can hideA QR code is text and nothing more, and the danger is not in the square but in the fact that a person cannot read it before acting on it.
- How to see what a device on your network connects toEvery answer tells you how to list the devices on your network; none tells you what they talk to.
All 10 guides under “A suspicious file, a device or a network”.
A letter, now and then
An occasional letter when there is something worth reading: the new guides and what changed in the tools. Never more than once a month and nothing else, and you can leave at any time on the unsubscribe page.