From Newsgroup: alt.comp.os.windows-11
On Tue, 8/25/2026 9:24 PM, Jeff Barnett wrote:
I did something incredibly careless: I accidentally deleted the folder C:\Windows\Temp then recreated a folder name "Temp" in the "Windows" directory. I had to answer a few permission prompts in order to be allowed to do the recreation.
I now get a message that the temp folder is not properly configured when a few applications were ran. What do I need to do (detailed instructions if possible) to rectify my mistake?
The sysdm.cpl panel, gives access to environment variables.
These are my "user" preferences for temp.
These are also the default settings.
TEMP=C:\Users\paul\AppData\Local\Temp
TMP=C:\Users\paul\AppData\Local\Temp
This is my "system" preferences for temp. Naturally,
items in C:\Windows have "more than casual permissions",
and we need to adjust this properly.
TEMP=C:\Windows\Temp
TMP=C:\Windows\Temp
******* CoPilot Question ************* # Note - I have reworded the question to avoid
spreading some bad advice!
This question is about Windows 11 OS.
In sysdm.cpl , we are given access to the environment variables.
"user" preferences for temp.
TEMP=C:\Users\paul\AppData\Local\Temp
TMP=C:\Users\paul\AppData\Local\Temp
"system" preference for temp
TEMP=C:\Windows\Temp
TMP=C:\Windows\Temp
How would I fix the ownership on these folders ?
******** CoPilot Answer ****************
You fix only the two folders:
- **User temp:** `C:\Users\<username>\AppData\Local\Temp`
- **System temp:** `C:\Windows\Temp`
Below is the correct, safe, targeted procedure.
## Correct permissions for **user** TEMP
Windows expects:
- Owner: **the user**
- Permissions: **Full Control** for the user
- Inheritance: **enabled** from AppData\Local
If you recreated the folder manually, you can repair it with:
cd /d C:\Users\paul\AppData\Local # Most likely to work in cmd prompt
takeown /F Temp /R /D Y
icacls Temp /inheritance:e /grant:r paul:(OI)(CI)(F)
### What this does
- takeown gives ownership back to your account.
- icacls restores inheritance and grants you full control.
---
## Correct permissions for **system** TEMP (`C:\Windows\Temp`)
This folder is **not** supposed to be owned by you.
It must be owned by **TrustedInstaller**, and SYSTEM/Administrators must have full control.
Here is the safe repair sequence: # Most likely to "fight you" (as Admin/AdminGroup)
# Impersonating TrustedInstaller is not generally easy
# Don't be surprised if the last line barfs.
cd /d C:\Windows
takeown /F Temp /A /R /D Y
icacls Temp /inheritance:e /grant:r "NT AUTHORITY\SYSTEM":(OI)(CI)(F) Administrators:(OI)(CI)(F)
icacls Temp /setowner "NT SERVICE\TrustedInstaller" /T
### What this does
- takeown /A assigns ownership temporarily to the Administrators group (not you).
- icacls restores SYSTEM + Administrators full control.
- icacls /setowner returns ownership to **TrustedInstaller**, which is required for Windows servicing.
******** End: CoPilot Answer ****************
Doing a Repair Install on the OS, using the same version of OS currently installed, would also restore the default folders. The "winver" command can give feedback on what you're running. If you have changed pointers to things, moved various C: things to the D: drive, then a Repair Install may fail.
Repair Install quote "works great" for people who haven't been
too adventurous :-) The same thing is true of Linux, where a Version Upgrade goes best, if you haven't tied the package manager in knots with a lot of clever stuff. There, you keep copious notes, of any "traps" you set for yourself, where there are "expected regrets" later. Windows is no different.
Paul
--- Synchronet 3.21d-Linux NewsLink 1.2