How to Fix “Unable to execute file in the temporary directory” Error on Windows 7, 8 and 10
Getting an Error 5 – Access Denied when trying to run a setup file means there is a problem with the permissions of your User. This error will come with a message saying Unable to execute files in the temporary directory, and you won’t be able to proceed with the setup.
This issue appears when you install software via an executable file, and when you get the popup you only have the option to dismiss it, but you can’t continue the installation. The error is most common with Windows 7, but it’s occurrence in previous, as well as following versions of Windows isn’t excluded.
The issue signals that your computer is blocking the setup because it is configured to do so, and it is more of a configuration mistake than a genuine error. However, there are a few things that you can do that will let you install whatever it was you were trying to install in the first place, so please read on to see how you can solve this issue.
Method 1: Run as administrator
Since the error code indicates a problem with the permissions, this can help bypass that.
- Find the executable file you want to install.
- Instead of double-clicking it, right-click it and select Run as administrator from the context menu. If you get a User Account Control, click
This is more of a workaround than a real solution, but if you’re in a pinch and you don’t have the time for the next, more extensive methods, this can help you install your software without the Error 5.
Method 2: Create a new Temp folder and change the variables
The error message clearly says that there is a problem with the temporary directory. Creating a new one and changing the variables to point there can solve this.
- In the C: drive, create a new folder, name it Temp. (Replace C: with the drive where your operating system is installed)
- Right-click This PC or My Computer, depending on which version of Windows you have, and select Properties from the menu.
- On the left side, there is an Advanced System Setting link, click it.
- In the window that opens, click on the Advanced tab, and click the Environment Variables
- In the User variables list, double click TMP
- The value should be %USERPROFILE%\AppData\Local\Temp. Change that to C:\Temp. Close the windows by pressing
- Try installing the program now, it should work as expected.
Method 3: Change the control over the Temp folder
- Go to your user’s folder, in the drive where your operating system is installed, and inside find the appdata folder, within which there’s a local If your operating system is installed in the C: partition, and your username is User, the address in the File Explorer should be:
C:\Users\User\AppData\Local
- Find the Temp folder inside, and right-click Select Properties from the menu.
- Inside the Properties window, go to the Security
- Click on everyone, and then click Edit. If Everyone is not an option, view the GiF below to see how to add Everyone.
- Make sure that the Full Control box is checked, and press OK to save the settings.
This gives full control over the Temp folder to all users of your system, which should solve the Error 5 permission issue.
Method 4: Check Include inheritable permissions in the permissions of the Temp folder
- As described in steps 1, 2 and 3 in the third method above, open the Security tab in the Properties of the Temp
- Click Advanced to see the permissions. There should be SYSTEM, Administrators, and User, and they should all have full control, and they should all be inherited from the C:\Users\User
- Find the Include inheritable permissions from this object’s parent option, and make sure it’s Click Continue, then Apply and finally OK to save the changes.
You should now have permissions to write to the directory, which essentially presents a solution to the Error 5 problem.
Windows’ permissions are a tricky thing for someone who doesn’t know what he’s doing. On one hand, properly set up permissions will make sure you don’t accidentally do any serious damage to the operating system. On the other hand, permissions may block you from doing certain tasks that you think are essential to you. No matter the case, follow the methods described above and you will solve the Error 5 – Access Denied issue in no time, and you will be able to install your software without any special procedures.