Execution
Prefetch Files (.pf)
Windows Prefetch cheat sheet: .pf location per version, run count, the last eight run times, referenced files, retention limits and how to parse.
- Location
- C:\Windows\Prefetch\<EXE>-<HASH>.pf
- Proves
- A specific executable ran, how many times, and when (up to 8 run times)
- Timestamps
- Last 8 run times (1 before Windows 8) as FILETIME, UTC, about 10 s after launch; .pf file $SI times, UTC
- Retention
- Capped at 128 files (XP to 7) or 1,024 (8+), oldest evicted; only the last 8 run times kept; disabled by default on Server
- Access
- Administrator; files not locked, plain copy works (robocopy /COPY:DAT keeps timestamps)
- Evidence of
- Execution
- Type
- File / file system
- Windows
- XPVista / 78 / 8.11011
- KAPE target
- Prefetch
- Velociraptor
- Windows.Triage.Targets:Prefetch
Tools
Compare all toolsWhat it is
Prefetch is a performance feature managed by the SysMain service (formerly Superfetch). When an application starts, Windows monitors the files it loads during roughly its first ten seconds and saves that list, together with run metadata, into a .pf file so the next launch is faster. For investigators each .pf file is one of the strongest pieces of evidence of execution on a workstation.
Location
| Windows version | Path | Format version |
|---|---|---|
| XP / Server 2003 | C:\Windows\Prefetch\*.pf | 17 |
| Vista / 7 | C:\Windows\Prefetch\*.pf | 23 |
| 8 / 8.1 | C:\Windows\Prefetch\*.pf | 26 |
| 10 / 11 | C:\Windows\Prefetch\*.pf (compressed, MAM signature) | 30 (some Windows 11 builds: 31) |
File name: <EXECUTABLE NAME>-<8 hex digit hash>.pf, for example CMD.EXE-0BD30981.pf. The hash is computed from the executable's full device path, so the same binary launched from two folders produces two .pf files. For "hosting" binaries (svchost.exe, dllhost.exe, rundll32.exe, mmc.exe) the command line is also hashed, which is why several .pf files exist for them.
The same folder also holds Layout.ini and the SysMain Ag*.db databases, which are separate artifacts.
What it proves
- Execution: the named executable was launched at least once from the path encoded in the file.
- How often and when: run count plus the most recent run time (Vista/7) or up to eight run times (8 and later).
- What it touched: DLLs, configuration files and documents opened in the first seconds of execution, with full volume paths. A document path listed in the Prefetch of
WINWORD.EXEor7Z.EXEshows that file was involved. - Which volume: volume device path, creation time and serial number, useful for tying execution to a removable drive.
Key fields
| Field | Meaning |
|---|---|
| Executable name | Upper-case name, truncated to 29 characters in the header |
| Hash | Path hash in the file name; different hash = different launch path or command line |
| Run count | Number of launches recorded by SysMain |
| Last run time(s) | 1 timestamp (XP–7) or up to 8 (8+), newest first |
| Volume information | Device path, serial number, creation time of each referenced volume |
| Files referenced | Full paths of files loaded during start-up |
| Directories referenced | Folders touched during start-up (Vista+) |
Timestamps
| Timestamp | Set when | Format | Pitfalls |
|---|---|---|---|
| Last run time(s) (embedded) | SysMain writes the .pf after the start-up monitoring window | FILETIME, UTC | Typically lands ~10 seconds after the actual process start; do not treat it as the exact launch second |
.pf file creation time ($SI) | First time the executable was prefetched | NTFS, UTC | Resets if the .pf was deleted and recreated, or evicted and recreated later |
.pf file modification time ($SI) | Last update of the .pf | NTFS, UTC | Usually matches the latest embedded run time |
| Volume creation time | Volume formatting | FILETIME, UTC | Describes the volume, not the execution |
Retention and clearing
- The folder is capped: 128 entries on XP–7 and 1,024 entries on Windows 8 and later. Older files are evicted when the limit is reached, so a missing
.pfdoes not prove the program never ran. - Only the most recent eight run times are kept; older runs are only reflected in the run count.
- Prefetching is controlled by
EnablePrefetcherunderHKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters(0 disabled, 1 applications, 2 boot, 3 both). It is disabled by default on Windows Server. - Attackers and cleanup tools delete
.pffiles. Deletions are often visible in the USN journal and the $MFT.
Collection
- KAPE target:
Prefetch - Velociraptor (
Windows.Triage.Targets):Prefetch - Built-in: the files are not locked, so a plain copy works. Use
robocopyto keep the original timestamps:
robocopy C:\Windows\Prefetch E:\case\Prefetch *.pf /COPY:DAT /DCOPY:T
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" /v EnablePrefetcher
Parsing tools
- PECmd (Eric Zimmerman, free):
PECmd.exe -d E:\case\Prefetch --csv E:\outproduces a per-file CSV and a timeline CSV of every run time. It decompresses Windows 10/11 files when run on Windows 8 or later. - WinPrefetchView (NirSoft, free): quick GUI review.
- libscca / pyscca (Joachim Metz, open source): library and
sccainfotool, with format documentation. - Velociraptor: the
Windows.Forensics.Prefetchartifact parses Prefetch on live endpoints. - Plaso: the
prefetchparser adds every run time to a super timeline.
Investigation tips
- Hunt for executables in user-writable locations (
\Users\Public\,\AppData\Local\Temp\,\ProgramData\) and for classic attacker tools (PSEXESVC.EXE,RCLONE.EXE,MIMIKATZ.EXE, renamedPROCDUMP). - Several hashes for the same name point to multiple launch locations: compare the file paths in each
.pfto find the unusual one. - Read the referenced-file list: a script host (
WSCRIPT.EXE,MSHTA.EXE) Prefetch that references a file inDownloadsoften reveals the initial payload. - Correlate with Amcache (SHA-1 of the binary), ShimCache and BAM (per-user attribution, which Prefetch lacks).
- On a system where Prefetch is empty or recent files are missing, check
EnablePrefetcherbefore concluding anti-forensics.
Related artifacts
- Amcache.hveAmcache.hve cheat sheet: file and program inventory keys, SHA-1 hashes, PE metadata, timestamps and why an entry alone does not prove execution.
- ShimCache (AppCompatCache)ShimCache (AppCompatCache) cheat sheet: SYSTEM hive location, entry limits per Windows version, ordering, timestamp meaning and execution caveats.
- BAM / DAM (Background Activity Moderator)BAM and DAM cheat sheet: SYSTEM hive keys per Windows 10 build, per-user SIDs, last execution FILETIME, seven-day retention and investigation tips.
- SRUM (System Resource Usage Monitor)SRUM cheat sheet: SRUDB.dat tables and GUIDs, per-app network bytes and CPU time, hourly UTC records, 30 to 60 day retention and ESE repair steps.
- UserAssistUserAssist cheat sheet: NTUSER.DAT GUID keys, ROT13 value names, run count, focus time and last run FILETIME for programs a user launched from Explorer.
Glossary terms
- Evidence of executionArtifacts that show a program actually ran on a Windows system, as opposed to merely existing on disk, and how strongly each one supports that claim.
- FILETIMEThe 64-bit Windows timestamp format counting 100-nanosecond intervals since 1 January 1601 UTC, used by NTFS, the registry and many artifacts.
- Volume serial numberThe identifier written to a volume when it is formatted; recorded in LNK files and Prefetch, it ties file activity to a specific volume.
- Anti-forensicsTechniques used to destroy, hide or falsify evidence, such as log clearing, timestomping, wiping and deleting shadow copies or the USN journal.
Guides
- Evidence of Execution: Prefetch, Amcache, BAM and MoreProve a program ran on Windows, not just existed: Prefetch, ShimCache, Amcache, BAM, UserAssist, SRUM, PCA, WER and 4688 compared, with parsing commands.
- Building a Super Timeline with PlasoBuild and filter a Windows super timeline with Plaso: log2timeline, psteal and psort flags, time zones, MACB, Timeline Explorer, EZ Tools CSVs and pivoting.