%temp% is an environment variable that points to your user Temp folder. To open it with %temp% in Run, press Windows logo key + R, type %temp% and press Enter. File Explorer opens the folder, which is typically C:\Users\<name>\AppData\Local\Temp. You can delete most of what is inside; files that are still open in an app cannot be deleted until that app lets go.
This guide explains what the Temp folder is for, the safest ways to clear it in Windows 11 and 10, and what to do when a file refuses to delete. For that last case, LockGhost and the free PowerToys File Locksmith can both show what is holding it.
What is %temp% in Windows?
Apps need somewhere to put short-lived files: installer payloads, unpacked updates, previews, crash logs and caches. Windows gives each user a Temp folder for this and exposes its location through the TEMP and TMP environment variables.
When an app asks Windows for the temp path, Microsoft’s GetTempPath documentation says Windows checks, in order:
- The
TMPenvironment variable. - The
TEMPenvironment variable. - The
USERPROFILEenvironment variable. - The Windows directory.
On a normal installation TMP and TEMP both point to your profile’s Temp folder. There is also a system-wide folder at C:\Windows\Temp that Windows and services use. This guide focuses on your user Temp folder, which is the one %temp% opens.
How do I open the Temp folder with Win+R?
- Press Windows logo key + R to open the Run dialog box (Microsoft lists this shortcut on its keyboard shortcuts page).
- Type
%temp%. - Press Enter or select OK.
You can also type %temp% into the File Explorer address bar. Both methods work the same in Windows 11 and Windows 10.
Where is the Temp folder (localappdata/temp)?
Microsoft’s USMT environment variable reference gives the typical path for TEMP and TMP as %USERPROFILE%\AppData\Local\Temp. Since %LOCALAPPDATA% is %USERPROFILE%\AppData\Local according to the KNOWNFOLDERID list, the Temp folder sits inside AppData\Local.
To see the exact path on your PC, open Command Prompt and run:
echo %TEMP%
AppData is hidden by default, which is why you may not find Temp by clicking through your user folder. Our guide to AppData Local vs Roaming vs LocalLow explains the rest of that folder.
Is it safe to delete everything in %temp%?
Deleting the contents of your user Temp folder is generally safe, with three rules:
- Close your apps first. Files that are open cannot be deleted, and an app that is mid-task may want its temp files back.
- Do not interrupt an installer or update. If something is installing, finish it and restart before clearing Temp.
- Delete the contents, not the folder. Leave the Temp folder itself in place.
Expect Windows to refuse a handful of files while you are signed in. That is normal: they belong to apps or services that are running.
How do I clear temp files safely?
Start with the built-in tools. They know which files are safe and skip what is in use.
Windows 11: Cleanup recommendations. Go to Start > Settings > System > Storage > Cleanup recommendations. Review the categories, including Temporary files, Large or unused files, Files synced to the cloud and Unused apps, select what to remove and select Clean up. Microsoft’s Free up drive space page covers each category. If you want to know how this compares with a duplicate finder, see Windows cleanup recommendations vs a duplicate finder.
Windows 10 and 11: Disk Cleanup. Type disk cleanup in the taskbar search box and select it. Tick the file types to delete; selecting a name shows its description. Microsoft notes that Downloaded Program Files, Temporary Internet Files and Thumbnails are selected by default. For more space, select Clean up system files.
Automatic: Storage Sense. Go to Start > Settings > System > Storage and set Storage Sense to On. Microsoft’s Storage Sense page says that with default settings it runs when the device is low on disk space, cleans up unnecessary temporary files, and empties old Recycle Bin items after some time. Items in Downloads and cloud folders are not touched unless you configure it to. It works on the system drive only. Select Storage Sense to choose how often it runs under Run Storage Sense.
Scripted: cleanmgr. Microsoft’s cleanmgr reference lets you save a Disk Cleanup selection with cleanmgr /sageset:1 and run it later with cleanmgr /sagerun:1, using the same number for both.
By hand. Open %temp%, press Ctrl+A and press Delete. When Windows reports that a file is open in another program, choose to skip it. This sends files to the Recycle Bin, so empty it afterwards if you need the space.
From the command line. del /q /f /s %TEMP%\* deletes files in Temp and its subfolders without prompting. Microsoft’s del reference warns that files deleted with del can’t be retrieved, so only use it when you are sure. In PowerShell, Remove-Item -Path "$env:TEMP\*" -Recurse -Force does the same job.
Why can’t I delete some temp files?
Almost always, a running program has the file open. Windows will not delete a file while a process holds it, and the error tells you the file is in use, sometimes without saying by what.
Try these in order:
- Close the apps you were using and try again.
- Restart the PC. This releases nearly every leftover handle, and the files usually delete cleanly afterwards.
- Find the process holding the file if it still refuses after a restart. Microsoft’s free PowerToys includes File Locksmith, which shows which processes are using a file. Our comparison of PowerToys File Locksmith and LockGhost covers the differences, and file is being used by another process (error 32) explains the error in depth.
When a file still will not delete after a restart, see exactly which process is holding it.
Get it from Microsoft
How does LockGhost fit in?
LockGhost does not clean temp files. According to its Microsoft Store listing, it identifies the process behind “file in use”, “access denied” and “cannot delete file” errors, shows friendly app names instead of bare process IDs, and offers safe resolution controls so you act only when you understand what is blocking the file. It works offline on Windows 10 and Windows 11, with no account and no subscription. If you already run PowerToys, File Locksmith may be all you need.
Why does the Temp folder fill up again?
Temp refills because apps keep using it. Installers, updates and browsers are the usual sources, which is why the folder grows back after a cleanup.
One specific case is on Microsoft’s list: if you see a Low Disk Space error soon after cleaning up, your Temp folder may be filling with .appx files used by Microsoft Store. Microsoft’s fix starts with resetting the Store: press Windows logo key + R, type wsreset.exe and select OK. A blank window opens, closes after about ten seconds, and the Store opens.
Also worth knowing: the large WinSxS folder is not a temp folder. See duplicate files in WinSxS: safe to delete? before touching it.
Frequently asked questions
Is it safe to delete %temp% files?
Yes, for files that are not in use. Close your apps first, do not interrupt an installer, and skip any file Windows says is open.
Why can’t I delete temporary files in Windows 11?
An app or installer still has them open. Close apps or restart and try again. If one file still refuses, PowerToys File Locksmith or LockGhost can show which process holds it.
How do I find my temporary files?
Press Windows logo key + R and type %temp%, or go to Settings > System > Storage > Cleanup recommendations and look at Temporary files.
Can I delete everything in the Windows temp folder?
You can delete the contents of your user Temp folder, but leave the folder itself. For the system folder at C:\Windows\Temp, use Disk Cleanup’s Clean up system files rather than deleting by hand.
How do I clear temp files automatically?
Turn on Storage Sense in Settings > System > Storage. With default settings it cleans unnecessary temporary files when the drive is low on space, and you can set it to run on a schedule.
Can I delete folders in AppData\Local too?
Only with care. Temp is safe to empty, but other folders belong to installed apps. See our AppData explainer before deleting anything there.
Try LockGhost
LockGhost is in the Microsoft Store for Windows 10 and 11. More detail is on the LockGhost product page.
Find what is locking a file in seconds, then decide what to do about it.
Get it from Microsoft
Windows and PowerToys are trademarks of the Microsoft group of companies. LockGhost is not affiliated with or endorsed by Microsoft.
Last updated 23 October 2026. Published by Automata Labs, a software company in Canada.