in win10 how to control temp folder. in my case it is…
- User
in win10 how to control temp folder. in my case it is C:\Users\MLP_PR~1\AppData\Local\Temp but i would like to control it. possible ? how ?
Assistant
To control the Temp folder in Windows 10 (including changing its location or managing its contents), follow these methods:
1. Change the Temp Folder Location
Via Environment Variables (recommended):
- Create a new folder where you want the Temp files stored (e.g.,
D:\CustomTemp). - Press
Win + R> Typesysdm.cpl> Go to the Advanced tab > Click Environment Variables. - Under User variables, select
TEMPand click Edit:- Set Variable value to your new path (e.g.,
D:\CustomTemp). - Repeat for
TMP(set it to the same path).
- Set Variable value to your new path (e.g.,
- Under System variables (if needed), edit
TEMPandTMPto the new path.
Note: Requires admin rights; affects all users. - Click OK > Restart your PC.
Using Command Line (advanced):
- Open Command Prompt (Admin) and run:
setx TEMP "D:\CustomTemp" setx TMP "D:\CustomTemp" - Restart your PC.
2. Automate Temp Folder Cleanup
Via Storage Sense:
- Go to Settings > System > Storage.
- Toggle Storage Sense ON.
- Click Configure Storage Sense:
- Under Temporary Files, check Delete temporary files that my apps aren't using.
- Set cleanup frequency (e.g., daily/weekly/monthly).
Manual Cleanup:
- Press
Win + R> Type%TEMP%> Press Enter. - Delete all contents (skip files in use).
Scheduled Task (for advanced users):
Create a batch script (
CleanTemp.bat):@echo off rd /s /q "%TEMP%" mkdir "%TEMP%"Then use Task Scheduler to run it periodically.
3. Fix Permission Issues
If apps can’t access the new Temp folder:
- Right-click your custom Temp folder > Properties > Security.
- Click Edit > Add.
- Enter your username > Check Full control > Apply.
4. Verify the Changes
- Press
Win + R> Typecmd> Run:
This should display your new path.echo %TEMP% echo %TMP%
Key Notes:
- Admin Rights Required: Changing system-wide variables or cleaning system Temp (
C:\Windows\Temp) needs admin privileges. - App Compatibility: Some legacy apps may not respect custom Temp paths. Test critical applications.
- Drive Type: Avoid network drives or slow storage for Temp—this can degrade performance.
- Data Loss: Cleaning Temp deletes transient files; avoid deleting files manually during active tasks.
By relocating the Temp folder, you can free up space on your system drive (e.g.,
C:) and manage storage more efficiently. Use Storage Sense for hassle-free maintenance.- Create a new folder where you want the Temp files stored (e.g.,
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.