Skip to contentGo to the directory tree
  1. C:
  2. Windows
FolderRisk: Do not touch

Windows C:\Windows

Operating system folder (%windir% and %SystemRoot% variables): system files, drivers, logs and components.

Updated on By AltF4 Formation

What it’s for

C:\Windows is the operating system’s installation folder. The %windir% and %SystemRoot% variables and the known folder ID FOLDERID_Windows all point to it. Scripts and applications should use them instead of a hard-coded path, because the drive letter can vary.

What it contains

  • System32: programs, 64-bit libraries, drivers and system configuration. SysWOW64 holds their 32-bit equivalents on 64-bit Windows.
  • WinSxS (component store), servicing and assembly: components and updates.
  • Logs, Temp, Prefetch, Fonts, Inf, Web, Boot and other folders covered in their own pages.
  • Executables at the root, such as regedit.exe or notepad.exe. For a 32-bit process, the file system redirector sends %windir%\regedit.exe to the 32-bit version.
  • Windows.old, left at the drive root after an upgrade, is a separate folder holding the previous installation.

Risks and best practices

  • Deleting, moving or renaming anything here by hand can make Windows unusable. To free space, use Disk Cleanup, the storage settings or DISM.
  • To repair system files, run DISM and then sfc /scannow, in that order.
  • The default permissions (TrustedInstaller, SYSTEM) protect the files. Do not change them to get around an access error.
  • An unexpected executable at the root or in a rarely monitored folder deserves a closer look.

Useful commands

Fenêtre de terminal
# Windows folder path and first level (read-only)
$env:windir
Get-ChildItem $env:windir -Force | Select-Object Name, Mode, LastWriteTime
Fenêtre de terminal
:: As administrator: verify system file integrity (makes no repair)
sfc /verifyonly
:: As administrator: repair the system image before sfc /scannow
DISM.exe /Online /Cleanup-image /Restorehealth

Folder contents

Folders 34

Report a mistake