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.

  1. Find the executable file you want to install.
  2. 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

run as admin

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.

  1. In the C: drive, create a new folder, name it Temp. (Replace C: with the drive where your operating system is installed)2016-10-12_142415 
  2. Right-click This PC or My Computer, depending on which version of Windows you have, and select Properties from the menu.2016-10-12_142537
  3. On the left side, there is an Advanced System Setting link, click it.
  4. In the window that opens, click on the Advanced tab, and click the Environment Variables2016-10-12_142704
  5. In the User variables list, double click TMP
  6. The value should be %USERPROFILE%\AppData\Local\Temp. Change that to C:\Temp. Close the windows by pressing2016-10-12_142806
  7. Try installing the program now, it should work as expected.

Method 3: Change the control over the Temp folder

  1. 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

  1. Find the Temp folder inside, and right-click Select Properties from the menu.
  2. Inside the Properties window, go to the Security
  3. Click on everyone, and then click Edit. If Everyone is not an option, view the GiF below to see how to add Everyone.
  4. Make sure that the Full Control box is checked, and press OK to save the settings.

change-the-control-over-the-temp-folder

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

  1. As described in steps 1, 2 and 3 in the third method above, open the Security tab in the Properties of the Temp
  2. 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
  3. 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.

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.