How to Fix Error Writing Temporary File: Make Sure your Temp Folder is Valid

Yesterday, I was trying to install Team Viewer software on my Windows 10 machine.

I downloaded Team Viewer from their official website and then started installing it by double-clicking the application file. However, as soon as I double-clicked the setup file, an error message popped up and said:

I got the same error around a year ago on my Windows 7 machine as well. Fortunately, I knew few methods this time to fix this error.

But, I also thought of writing this article so that it can benefit other users also who are getting the same error.

Why Does Error Writing Temporary File Occur?

First of all, let me make this very clear that this error is not specific to Team Viewer or any other software.

You can get this error while installing any software. It has nothing to do with the software being installed. It’s just some settings in your system that needs to be fixed.

Now coming back to the root cause of this error. Whenever you try to install any software on a Windows machine, it looks for the temp folder to store some data as it writes the registry.

If the temp folder is not set up correctly on your system, this can very well cause error. In such a case, we need to play a bit with the environment variables on our system which you will see shortly.

In the upcoming section, you will get to look at a number of verified methods that can potentially resolve this issue.

How To Fix Error Writing Temporary File?

Let us get started to implement the methods to get rid of this error. By the end of this section, you should be able to install the software that this causing.

Method 1: Compress The Folder (Workaround)

This is one of the workarounds that has worked very well for most of the users. Since it is easy and less time-consuming, we recommend you implement this method first before trying to implement the other methods. Simply follow the steps given below to implement this workaround:

  • Go to the Downloads folder and look for the Installer file that was causing this error.
  • Right-click on this file and choose the Send to option.
  • This will open another menu. Here, choose the Compressed (Zipped) folder option.
  • Your installed file will be zipped inside a folder with the same name.
  • Now open this zipped folder.
  • Double click on the installer file to start the installation process.
  • This should run now without any error. For me, this worked. However, if this workaround is not able to resolve this issue for you, better try the next methods that we listed below. These are much more technical and can resolve this issue once and for all.

Method 2: Check If You Have Correct Environment Variable Set Up

As mentioned above, this error usually occurs when the installer is not able to locate the temp folder on your machine.

How would the installer come to know the exact path of the temp folder? Well, we have some Environment Variables defined in our system. These variables let the installer know the exact path to the temp folder.

Let us, deep-dive, into this method and verify if we have the correct variables defined. If not, we can set them up correctly.

  • Right-click on My Computer/ Computer/ This PC depending on the Windows version you are using.
  • This will open a Control Panel window. Here, click on the Advanced System Settings option from the left menu.
  • Now click on the Environment Variables button.
  • Here, you will see all the defined environment variables. You need to check if you have TEMP and TMP environment variables defined exactly as shown in the screenshot below.
  • If these are not defined in your system, simply click on the New button and add them one by one.
  • Once done, try installing the software that was causing the Error writing temporary file. Hopefully, you should be able to install the software this time.

Method 3: Clean Reboot Your System

The steps listed below will help you in clean rebooting your PC. This can also fix the Error Writing temporary file issue. After implementing these methods, try to install the software that is causing this error and let us know how this method worked for you.

  • Go to Control Panel and choose the System and Security link.
  • Now select Administrative Tools.
  • Double click on the System Configuration option.
  • Now choose the Services tab.
  • Checkmark Hide all Microsoft services options.
  • Now press the Disable all button on the left. Click Apply and OK button.
  • Now Restart the system by clicking on the Restart button.
  • That’s all. You have clean rebooted your system. Now try installing the software and check if the error still persists.

Method 4: Change The Permission

  • Click the Start button and click My Computer.
  • Double-click to open drive C.
  • Right-click the Windows folder and choose Properties.
  • Click to clear the Read-only check box if it is selected.
  • Repeat these steps for the TEMP folder and the System folder inside the Windows folder.
  • Once these steps are complete, close any open windows and restart the computer.

Method 5: Run “chkdsk” Command

  • Open Command Prompt as administrator.
  • Enter chkdsk X: /r and press Enter. Be sure to replace X with the letter that matches your hard drive partition that you’re installing the application to. If you’re trying to scan your system partition you’ll have to schedule a restart and scan your partition before Windows 10 starts.
  • Now try to run the installation process again.

Final Words

In case of any issues regarding the methods given above, feel free to reach out to us via comments or the Contact Us page. We will try to resolve your issue at the earliest. Stay tuned. Thanks.

Robert Borowski is passionate about blogging and wants to share knowledge with others. His passion, dedication, and quick decision-making quality make him stand from others.

Leave a comment