Join our Newsletter — 33% off our NHI Course
Home› Guides› Windows Prefetch Forensics Guide: Proving Program Execution and…
Guide Incident Response & Forensics

Windows Prefetch Forensics Guide: Proving Program Execution and Its Limits

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 20 November 2026 14 min read
On this page

Windows Prefetch files are one of the strongest host artefacts for showing that a program ran, how many times, and when it last ran, but only if you understand how they are named, versioned, compressed and limited. This guide explains the format, what each field supports in an investigation, how to collect and parse Prefetch safely, and where the evidence stops.

Our Windows Forensic Artefacts Guide introduces Prefetch alongside Amcache and ShimCache. This page goes deeper on Prefetch alone. Format details come from the libyal libscca format documentation. Tooling details come from the PECmd project documentation and the Velociraptor Prefetch artifact reference, and the prefetcher configuration value comes from Microsoft documentation. Where those sources do not describe something, this guide leaves it out rather than repeating common lore.

Key takeaways

  • Prefetch files live in C:\Windows\Prefetch\ and are named <EXECUTABLE>-<HASH>.pf, where the hash is derived from the executable's path.
  • Format version 26 and later (Windows 8 onwards) store up to eight last run times plus a run count. Older versions store one.
  • From Windows 10 the files are compressed in a MAM container with XPRESS Huffman, so you need a parser that handles it.
  • Each file also lists volumes and files referenced during startup, which can reveal paths, removable media and staging folders.
  • Prefetch supports execution. It does not show who ran the program, the command line, or that it completed its task.
  • Absence of a Prefetch file is weak evidence. The prefetcher can be configured off, and files can be deleted.

What Prefetch is and why it matters

The Windows prefetcher records which files and directories an application touches as it starts, so that later starts can be faster. The Velociraptor artifact reference summarises it plainly: when an executable is run, the system records properties about it to make it faster to run next time. For investigators, the side effect is a per-executable record that survives after the program has been deleted.

That makes Prefetch valuable for questions such as:

  • Did this tool run on the host at all?
  • When did it last run, and roughly how often?
  • From which path and volume did it run, and was that a removable drive or a user-writable folder?
  • What other files did it load at start-up, such as DLLs, configuration files or output files in a staging directory?

These map directly to MITRE ATT&CK execution techniques such as T1204 User Execution, T1059 Command and Scripting Interpreter and T1569.002 Service Execution, where you need host evidence that a binary actually ran rather than just existed on disk.

Location, naming and the path hash

According to the libscca documentation, Prefetch files are stored in C:\Windows\Prefetch\ with names in the form <executable filename>-<prefetch hash>.pf, usually in upper case, for example NOTEPAD.EXE-189578DA.pf. The executable name in the file name is truncated to 29 characters.

The hash is calculated from the executable's full device path. The documentation lists three algorithms: an XP hash for Windows XP and 2003, a "2008" hash for Windows 2008, 7, 2012 and 8 (including 8.1), and a Vista hash used on Vista and Windows 10. It also notes that on Windows 10 paths inside the file are shown with a \VOLUME{identifier} prefix while the hash is still computed over the \DEVICE\HARDDISKVOLUME# form.

Why this matters:

  • Same name, different hash means different path. Two files such as POWERSHELL.EXE-AAAA.pf and POWERSHELL.EXE-BBBB.pf indicate the same executable name run from two locations. One may be the system copy and the other a copy in a temporary folder.
  • Confirm the path. Do not infer the path from the hash alone. Read it from the referenced files list, which normally includes the executable itself.
  • Alternate data streams show up. The libscca documentation gives the example that running notepad.exe:evil.exe produces notepad.exe:evil.pf. A colon in a Prefetch name is worth investigating.

Format versions and compression

The libscca documentation lists these format versions:

VersionWindows releaseLast run times stored
17Windows XP, 20031
23Windows Vista, 71
26Windows 8.0, 8.1Up to 8
30Windows 10Up to 8
31Windows 11Up to 8 (described with version 30 structures)

Version 30 has two documented variants of the file information structure, 220 and 212 bytes, with the run count at different offsets. Good parsers handle both. If you are validating a parser or writing your own, test against samples of each variant.

From Windows 10, the documentation states that the Prefetch file is stored compressed in a MAM container with the signature MAM\x04 followed by the uncompressed size, and that the compression method is XPRESS Huffman. A hex editor will show the MAM signature rather than the SCCA signature you see in older or decompressed files. The PECmd documentation states that it decompresses Windows 10 and 11 files, and that its .NET 10 build can do so on Linux and macOS as well as Windows.

Once decompressed, the header contains the format version, the SCCA signature, the file size, the executable name (60 bytes of UTF-16 little-endian text) and the prefetch hash, plus a flag where 0x01 marks a boot prefetch.

The fields that matter and what each one supports

Last run times

The libscca documentation states that version 26 and later record up to eight last run times as FILETIME values, the first being the most recent, with unused entries set to zero. Versions 17 and 23 hold a single value. These are the most cited Prefetch fields and they are strong evidence of when the executable started on this host.

Two cautions apply. First, eight entries is a rolling window, so a frequently used tool will only show its most recent runs. Second, treat every time as UTC and convert it consistently in your timeline. PECmd's JSON output uses ISO 8601 UTC timestamps, and its --mp option displays higher precision.

Run count

Each version stores a run count. It is useful context: a tool with a run count of one on a server that has existed for years looks different from one with a run count in the hundreds. Do not treat it as an exact audit count without corroboration. Report it as "the Prefetch run count recorded for this file".

File system timestamps of the .pf file

The .pf file itself has creation and modification times. The Velociraptor artifact reference states that on Windows 10 you can see the last eight execution times and the creation time, which it describes as nine potential executions. A creation time older than the oldest of the eight embedded run times suggests earlier runs that have rolled out of the list. Treat it as an indicator, and remember that copying or restoring files changes file system times.

Volume information

Each file contains one or more volume entries with a device path, a volume creation time and a volume serial number, according to the libscca documentation. This lets you tie an execution to a specific volume. If the serial number does not match the system drive, the program or a file it loaded may have come from removable media or a mounted image. Cross-reference serial numbers with device artefacts, as covered in our USB Device Forensics Guide.

Referenced files and directories

The metrics and filename strings sections list files the executable touched while starting, and a directory strings section lists directories. PECmd reports these as directories and files loaded, and Velociraptor offers an IncludeFilesAccessed option to include them. This is often where the best leads come from:

  • The executable's own full path, which confirms where it ran from.
  • DLLs loaded from unusual locations, which may indicate side-loading.
  • Files in staging or temporary folders, including archives or output files.
  • Paths on other volumes or network locations.

Remember that this list reflects what was touched during start-up, not everything the program did. Absence of a file in the list does not mean the program never accessed it.

When the prefetcher is off

Microsoft documentation for Windows Embedded Standard 7 describes the configuration value EnablePrefetcher, a REG_DWORD under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters. It documents four values: 0 disabled, 1 application start prefetching enabled, 2 boot prefetching enabled, and 3 both. That page is specific to an embedded release, so confirm the value on the host you are examining rather than assuming a default for any edition.

Before you rely on Prefetch, and especially before you rely on the absence of a file, check this value in the SYSTEM hive you collected, and check whether the Prefetch folder contains files at all. An empty or near-empty folder on a host that has clearly been in use is itself a finding. It may reflect configuration, a clean-up tool, or deliberate deletion that fits MITRE ATT&CK T1070.004 File Deletion. Our Anti-Forensics Detection Guide covers how to tell these apart.

Collecting and parsing Prefetch

Prefetch files are small and easy to collect, which makes it tempting to be careless. A sound approach:

  1. Collect the whole folder. Take every file in C:\Windows\Prefetch\ with its file system metadata, and hash the set.
  2. Collect the SYSTEM hive. You need it to confirm the EnablePrefetcher value and for wider context.
  3. Check volume shadow copies. PECmd documents a --vss option that processes all volume shadow copies on the drive given with -f or -d (Windows only). Older copies can hold Prefetch files that were later deleted or rolled over.
  4. Parse with a tool that handles compression. Use -f for a single file or -d for a directory, with --csv or --json for output. PECmd writes a main CSV with one row per Prefetch file and a timeline CSV with one row per run time, which drops straight into a super timeline.
  5. Use keyword highlighting for triage. PECmd highlights temp and tmp in console output by default and accepts extra comma-separated keywords with -k, such as the names of tools you are hunting for.

For collection across many endpoints, the Velociraptor Windows.Forensics.Prefetch artifact parses files matching C:\Windows\Prefetch\*.pf by default and supports dateAfter, dateBefore, binaryRegex and hashRegex filters. That lets you ask a fleet-wide question such as "which hosts have a Prefetch file for this tool name with a run time in the incident window". Our EZ Tools Guide covers PECmd alongside the rest of that toolset.

An illustrative hunting pattern, not tied to a specific product, for a parsed timeline export:

PrefetchTimeline | where RunTime between (start .. end) | where ExecutableName in (watchlist) or SourcePath contains "\\TEMP\\" or SourcePath contains "\\USERS\\PUBLIC\\" | order by RunTime asc

Field names differ between tools, so map them to your parser's actual output before running anything like this.

What Prefetch can and cannot prove

What it supports well

  • That an executable with a given name, from a path that produces the recorded hash, was started on this host.
  • The most recent start times recorded for that executable, up to eight on Windows 8 and later.
  • The volume, and often the full path, it started from.
  • Files and directories it touched during start-up.

Where it stops

  • Who ran it. Prefetch is system-wide. It does not record a user or SID. Attribute execution through logon sessions, process creation events and user-specific artefacts. Our Windows Event Log Guide covers logon and process events.
  • Command line and arguments. Prefetch does not store them. Process creation auditing or endpoint telemetry is required.
  • Success. A recorded start does not prove the program completed its task, connected anywhere or produced output.
  • Every run. The rolling eight-entry list and the run count give a partial history, not an audit trail.
  • Absence. No Prefetch file does not prove the program never ran. Configuration, deletion and file rotation all remove evidence.
  • Integrity. Files can be deleted or replaced. Look for consistency between embedded times, file system times and other artefacts.

Corroborating Prefetch with other artefacts

Prefetch is strongest in combination. Useful pairings:

  • Amcache and ShimCache. Amcache can provide a file hash and metadata for the same path, and ShimCache supports presence of the file. See our Amcache and ShimCache Forensics Guide.
  • Event logs. Process creation and logon events add user, parent process and command line where auditing was enabled.
  • SRUM. Per-application network and disk usage for the same executable helps show what it did after starting. See our SRUM Forensics Guide.
  • Jump lists, LNK files and user registry artefacts. These help attribute execution to a specific user profile. See our Jump Lists and LNK Files Forensics Guide.
  • File system metadata. The MFT and USN journal can show when the executable arrived and was deleted, bracketing the Prefetch run times.

When Prefetch run times and other sources disagree slightly, look for explanations such as clock changes, time zone conversion errors or a parser bug before concluding anything sinister. Record the tool and version used for every conversion.

Prefetch and non-human identities

Many intrusions run tools under service accounts, scheduled tasks or remote execution services rather than an interactive user. Prefetch records these runs just the same, which is useful, but it cannot tell you which account was used. Pair a Prefetch hit for a remote administration or service binary with service installation and logon events to identify the account. If that account is a service or machine identity, the scoping question becomes where else that credential is valid. Our Identity Incident Response Playbook covers that next step.

Common failure patterns

  • Parsing compressed files with an old tool. Windows 10 and 11 files need XPRESS Huffman decompression first, and older tools may fail silently or report nothing.
  • Treating the last run time as the only run. On Windows 8 and later there are up to eight times to review, and the .pf file creation time may point to earlier runs.
  • Attributing execution to a user from Prefetch alone. Prefetch has no user field.
  • Reading absence as proof. Check EnablePrefetcher, folder contents and shadow copies first.
  • Ignoring the hash. Two files with the same executable name but different hashes indicate different paths, which is often the key detail.
  • Skipping referenced files. The loaded files and directories often reveal staging folders, side-loaded DLLs and removable media.
  • Mixing time zones. Embedded times are FILETIME values. Normalise to UTC and state it.
  • Collecting from the live folder with file copy tools that alter metadata. Use a forensic collector so file system times are preserved.

Practitioner checklist

  • Collect the full Prefetch folder with metadata, plus the SYSTEM hive, and hash everything.
  • Confirm the EnablePrefetcher value and whether the folder is populated before relying on absence.
  • Parse with a tool that handles MAM compression, and check volume shadow copies for older files.
  • Review all embedded run times, the run count and the .pf creation time for each file of interest.
  • Compare hashes for executables that appear more than once, and confirm paths from the referenced files list.
  • Check volume serial numbers against the system drive and device artefacts.
  • Attribute runs to accounts using event logs and user artefacts, not Prefetch.
  • Add the timeline output to a super timeline in UTC and record tool versions.
  • Write findings in calibrated language that states what Prefetch cannot show.

Standards and references

Related NHI Mgmt Group resources: Windows Forensic Artefacts Guide · Amcache and ShimCache Forensics Guide · Forensic Timeline Analysis Guide · Digital Forensics (DFIR) Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.