Home » How To » SOLVED: Error Writing Temporary File, Valid Temp Folder

SOLVED: Error Writing Temporary File, Valid Temp Folder

If you ever see the pop-up error message Error writing temporary file, Make sure your temp folder is valid while installing, updating, or uninstalling applications, it means that for whatever reason, Windows is unable to read or write to the temp folder.

You might see the error writing temporary file message for several reasons, including but not limited to insufficient permissions, corrupted files in the temp folder, corrupted temp folder, interference by Windows Defender, stuck Windows Installer service, etc.

Whatever the reason, you can use the methods listed below to fix the problem and make sure the temp folder is valid and accessible by Windows.

Fix Error writing temporary file, Make sure your temp folder is valid

Follow the below methods when you encounter the ‘Error writing temporary file, Make sure your temp folder is valid’ pop-up error message.

  1. Clean the temp folder
  2. Disable read-only for temp folder
  3. Install/uninstall the application as admin
  4. Restart the Windows installer service
  5. Disable Windows Defender temporarily
  6. Clean boot Windows
  7. Reset Windows

Let’s see each step in detail:

1. Clean the temp folder

Corrupted or invalid files in the temp folder can often cause bizarre problems and stop Windows from writing files to it. So you should clean the temp folder and make sure it is valid and reachable. Here’s how to do it.

  1. Launch the Run window using the “Windows key + I” shortcut.
  2. Type “%temp%” in the blank field.
  3. Click/tap the “Ok” button in the Run window.
  4. Select all the files and folders in the temp folder with the “Ctrl + A” shortcut.
  5. Press the “Delete” key on your keyboard.
  6. If prompted, select the “Do this for all current items” checkbox.
  7. Press the “Continue” button.
  8. With that, the temp folder is cleared.

Note: Sometimes, a few files and folders may be in use and Windows cannot delete them. In that case, skip them. If needed, you can restart the system and try again.

clear temp folder to fix error writing temporary file pop-up error message

2. Disable read-only for the temp folder

Sometimes, the temp folder’s read-only mode can interfere with Windows and cause the ‘error writing temporary file’ message. So, check and disable read-only access for the temp folder.

  1. Press the “Start key + R” to open the Run window.
  2. Type “%localappdata%” (without quotes) in the blank field.
  3. Press the “Ok” button in the Run window.
  4. Right-click on the “Temp” folder.
  5. Choose the “Properties” option from the context menu.
  6. Navigate to the “General” tab.
  7. Uncheck the “Read-only” checkbox.
  8. Press the “Ok” button.
disable read only access to temp folder

After disabling the temp folder’s read-only access, try installing the prompt and the problem should be fixed.

3. Install/uninstall the application as admin

Oftentimes, you might also see this error when your Windows user account doesn’t have sufficient permissions. So, try installing or uninstalling the application as an admin. To do that, right-click on the installer file and select the “Run as administrator” option.

If you are trying to uninstall an application, find the uninstaller exe file which is usually located in the Program Files folder, right-click on the uninstaller file, and select the “Run as administrator” option.

4. Restart the Windows Installer service

Restart the Windows Installer service to fix the error:

  1. Open Start.
  2. Search for “services” in the Start menu.
  3. Click on the appropriate result to open Windows Services.
  4. Find and right-click on the Windows Installer service.
  5. Select the “Restart” option.

Note: If the service is stopped or not running, select the “Start” option to start the Windows Installer service.

5. Disable Windows Defender temporarily

When you see cannot write temporary file error, you can try disabling Windows Defender temporarily and installing/uninstalling the application after that.

6. Clean boot Windows

Clean booting Windows disables all the unnecessary services and allows Windows to access the temp folder and fixes the error writing the temporary file to temp folder problem. Follow these instructions to clean boot Windows.

7. Reset Windows

Finally, when everything fails to solve the problem, it might be because of the corrupted system files. In that case, you have no other way but to reset Windows. Before resetting, backup all the important user files in the C drive (C:\Users\YourUsername) and the application settings.

That is all. It is that simple to fix the problem, validate the temp folder, and allow Windows access to the temp folder.

I hope this simple and easy Windows how-to guide helped you.

If you are stuck or need help, send an email, and I will try to help as much as possible.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top