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.
- Clean the temp folder
- Disable read-only for temp folder
- Install/uninstall the application as admin
- Restart the Windows installer service
- Disable Windows Defender temporarily
- Clean boot Windows
- 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.
- Launch the Run window using the “Windows key + I” shortcut.
- Type “%temp%” in the blank field.
- Click/tap the “Ok” button in the Run window.
- Select all the files and folders in the temp folder with the “Ctrl + A” shortcut.
- Press the “Delete” key on your keyboard.
- If prompted, select the “Do this for all current items” checkbox.
- Press the “Continue” button.
- 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.
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.
- Press the “Start key + R” to open the Run window.
- Type “%localappdata%” (without quotes) in the blank field.
- Press the “Ok” button in the Run window.
- Right-click on the “Temp” folder.
- Choose the “Properties” option from the context menu.
- Navigate to the “General” tab.
- Uncheck the “Read-only” checkbox.
- Press the “Ok” button.
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:
- Open Start.
- Search for “services” in the Start menu.
- Click on the appropriate result to open Windows Services.
- Find and right-click on the Windows Installer service.
- 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.