• Recreating temp folder

    From Jeff Barnett@jbb@notatt.com to alt.comp.os.windows-11 on Tue Aug 25 19:24:59 2026
    From Newsgroup: alt.comp.os.windows-11

    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?
    --
    Jeff Barnett

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From sticks@wolverine01@charter.net to alt.comp.os.windows-11 on Tue Aug 25 21:08:52 2026
    From Newsgroup: alt.comp.os.windows-11

    On 8/25/2026 8: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?

    If you plug your exact wording into google it gives this:


    ====================================================================== REPAIRING CORRUPTED OR RECREATED C:\WINDOWS\TEMP FOLDER PERMISSIONS ======================================================================

    If you accidentally deleted C:\Windows\Temp and recreated it manually,
    Windows applications will throw errors because the folder lacks the
    correct system-level Access Control Lists (ACLs).

    Follow these steps to restore the original folder security settings:

    STEP 1: FIX FOLDER PERMISSIONS & INHERITANCE ----------------------------------------------------------------------
    1. Open File Explorer and navigate to C:\Windows
    2. Right-click the "Temp" folder and select PROPERTIES.
    3. Switch to the SECURITY tab and click the ADVANCED button.
    4. Click CHANGE PERMISSIONS (if prompted with an Admin shield).
    5. At the bottom, check the box: "Replace all child object permission
    entries with inheritable permission entries from this object".
    6. Click APPLY. If a warning popup appears, click YES, then click OK.


    STEP 2: VERIFY REQUIRED ACCESS GROUPS ----------------------------------------------------------------------
    While still in the Advanced Security Settings window, verify the
    Permission Entries list matches the default Windows configuration:

    * SYSTEM: Full Control (Applies to: This folder, subfolders, files)
    * Administrators: Full Control (Applies to: This folder, subfolders, files)
    * Users: Read, Write, Execute
    (Specifically: Create Files/Folders)
    * CREATOR OWNER: Full Control
    (Applies to: Subfolders and files only)

    If any group is missing, click ADD -> SELECT A PRINCIPAL, type the
    missing name (e.g., SYSTEM), and assign the listed permissions.


    STEP 3: CLEAR THE READ-ONLY ATTRIBUTE ----------------------------------------------------------------------
    1. Close the Advanced window to return to the main Temp Properties window.
    2. Switch to the GENERAL tab.
    3. Under Attributes, uncheck the READ-ONLY box if it is filled/checked.
    4. Click APPLY.
    5. Select "Apply changes to this folder, subfolders and files".
    6. Click OK.


    STEP 4: REBOOT THE SYSTEM ----------------------------------------------------------------------
    Restart your PC. This forces Windows and background services to release
    locks and re-initialize using the corrected temporary directory.

    ======================================================================
    --
    Science Doesn’t Support Darwin. Scientists Do

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Paul@nospam@needed.invalid to alt.comp.os.windows-11 on Tue Aug 25 23:01:02 2026
    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