When trying to run a setup file, many users receive the “unable to execute file in temporary directory” error message. How to fix the error? If you are also trying to fix it, this post of MiniTool is what you need.
According to user reports, the “unable to execute file in the temporary directory. Setup aborted. Error 5” message often appears when running a setup file to install a program. The error indicates that you are making changes to the temp folder which you don’t have access to.
It is annoying that the program installation fails due to the “unable to execute file in the temporary directory” error. Fortunately, we summarized several tested solutions to the error. Now, you can try them one by one.
Many people reported that their hard drive won’t power up. Are you also troubled by the issue? This post will help you fix external hard drive not powering up.
Fix 1. Run the File as Administrator
Sometimes, the “unable to execute file in the temporary directory Windows 10” can occur when lacking admin right. So, the first and simplest solution is to run the setup file as an administrator. Here’s how:
Step 1. Right-click the setup file and select Properties.
Step 2. In the Properties window, navigate to the Compatibility tab and tick the checkbox next to Run this program as an administrator. Then click on OK to save the change.
Now, you can install the program again and see if the “unable to execute file in the temporary directory error 5” message persists.
Fix 2. Create a New Temporary Folder
In addition, you can fix the “Unable to access directory for installation” error by creating a new temp folder. Let’s follow the steps below:
Step 1. Press Win + E keys to open the File Explorer, and then open the C: drive and create a new folder named Temp.
Step 2. Right-click This PC and select Properties.
Step 3. Click on Advanced system settings, and then navigate to the Advanced tab and click on Environment Variables.
Step 4. Double click on TMP, and then change its Variable value from %USERPROFILE%\AppData\Local\Temp to C:\Temp and click on OK to save changes.
After that, you can close the window and install the software to check if the “unable to execute file in temporary directory” error is fixed.
Fix 3. Check the Security Right for the Temporary Folder
Sometimes, the “unable to execute file in temporary directory” error can be caused by improper security rights. In this case, you can follow the steps below to check security right for the file:
Step 1. Press Win + R keys to open the Run dialog box, and then type %localappdata% in it and hit Enter.
Step 2. Right-click the Temp folder and select Properties.
Step 3. Navigate to the Security tab and click on Advanced.
Step 4. In the Permission entries section, you will see the following 3 options:
- SYSTEM with Full Control that applies to “This folder, subfolders, and files”.
- Administrator with Full Control that applies to “This folder, subfolders, and files”.
- Your Username with Full Control that applies to “This folder, subfolders, and files”.
Step 5. Tick the checkbox next to Replace all child object permission entries with inheritable permission entries from this object and make sure the Inheritance is enabled.
Step 6. Click on Apply and OK to execute changes.
Now, you can restart the computer and see if the “unable to execute file in temporary directory” error is resolved.
The partitions on the disk selected for installation are not in the recommended order. Have you come across the error? This post will help you fix it.