Some users have reported a popup error stating, Error writing temporary file. Make sure your temp folder is valid while installing or uninstalling software on Windows. Fixing this Error is pretty straightforward, and below, we have mentioned a couple of ways to do it.
Error writing temporary file, Make sure your temp folder is valid
The Error writing temporary file, Make sure your temp folder is valid indicates that Windows cannot read or write inside the temp folder. So there are a couple of ways to help Windows access the temp folder and use it for installation or removing a program. These methods are:
- Try Running the installer as an admin
- Restart the Windows Installer Service
- Clean Temp Folder
- Create a New Temp Folder and Change the Variables
- Disable Windows Defender
Now let’s talk about these methods briefly below:
1] Try Running the installer as an admin
If you cannot install a program usually, you should try installing it as an admin. This will ensure the installer has full permission to run on your PC, and any error message will be bypassed.
For this, right-click on the installer, click the Select Run as administrator option, and then follow all the onscreen steps.
2] Restart the Windows Installer Service
You can also restart the Windows Installer Service as an additional recommendation.
3] Clean the Temp folder
There is also a good chance that your temp folder files are corrupted or take up too much space on your PC. As a result, you are encountering the make sure your temp folder is a valid error.
You can try cleaning your Temp folder. To clean your temp folder, follow these steps:
- Press Windows Key + R to launch the Run dialog.
- Type %temp% and press Enter key.
- Press CTRL + A keys to select all the files.
- Then click on the Delete button located at the top bar. (Some files may not get deleted, so leave them as it is.)
- Once done, try reinstalling the program, and you should be ready.
4] Create a New Temp Folder and Change the Variables
The error says that your temp folder is not valid. So there is a good chance that Windows has a problem accessing or writing inside the temp folder. To fix this, you can create a new temp folder and change the variables to force Windows to use your new temp folder.
To do this, follow the below steps:
- Go to your System or C Drive.
- Over here, please create a new folder and name it Temp.
- Press Windows + I to launch Settings.
- Navigate to System > About.
- Over here, click on Advanced System Settings, located under Device specifications.
- Click on Environment Variables.
- Double-click on the TMP variable.
- Over here, the existing variable value would be
- Change the variable value to C:\Temp and click on OK.
- Close all the Windows and rerun the installer to check if you encounter the error.
5] Disable Windows Defender or System security software
The culprit could be your Windows Defender or any security software you use. There is a chance that it is blocking the installer, which can result in several issues. So to be safer, try disabling Windows Defender while you run the installer and then see if you are still facing the same error.
For this, follow the below steps:
- Go to Windows Search.
- Type Windows Security and launch it.
- Click on Virus & threat protection from the sidebar.
- Under Virus & threat protection settings, select Manage settings.
- Over here, toggle off Real-time protection.
- Now run your installer and see if it works.
The above methods should help you eliminate the issue— Error writing temporary file. Make sure your temp folder is valid error. However, even after trying the above methods, consider resetting your PC if you still encounter the same error. There is a good chance your PC’s system files corrupted which could lead to the error.
How do I fix a corrupted Temp folder?
The only way to fix a corrupted Temp folder is either by deleting the data inside it or recreating the temp older somewhere else and pointing the OS to use that as a temporary folder.
Can corrupted files be repaired?
They can be repaired only if their head information is corrupt and system tools can fix it. However, if the complete file is corrupt, you cannot recover it. The last option is to use recovery software to partially or fully recover the files’ previous versions.