On this page, you will find four solutions to fix the issue of not being able to execute a file in the temporary directory:

Please provide the English content you want translated, and I'll do my best to translate it into Chinese.

Possible Solutions Step-by-step troubleshooting
Possible Solutions Step-by-step troubleshooting
Solution 1. Run the file as an administrator Right-click the installer file > Choose "Run as administrator"...
Solution 2. Check security permissions Navigate to C:\Users\[Username]\AppData\Local > Right-click the Temp folder and choose "Properties"...
Solution 3. Create a new Temp folder Navigate to C: and create a new folder named Temp > Right-click Computer and choose "Properties"...
Solution 4. Disable the firewall Disable your antivirus, antispyware, and firewall applications...

Unable to execute file in temporary directory

Unable to execute file in the temporary directory

When you try to run an installer to install a program, you may see the error above. However, don't take it out on the software or doubt its source – the app itself is innocent. This issue is typically caused by system problems or software protection tools. The “Setup was unable to run in the temporary directory. Installation aborted. Error 5: Access is denied” error means that you're trying to modify a folder you don't have permissions for, as the notification clearly states – “Access is denied.”

Usually, closing the window will not allow the installation to proceed. You need to resolve this issue before proceeding with the installation.

4 Ways to Fix the 'Permission Denied' Error When Running a File in Temp Directory

To fix the cannot execute file error, try these four tricks. After attempting any of these tricks, reinstall the software and see if Error 5 still appears.

Solution 1: Run the file as an administrator

Similar to the error you get when trying to do something that requires admin rights on a PC you don't own – “You need administrator permission to copy this file/folder” – you might be restricted in what you can do. Most people struggling with software installations because of this bug claim that they managed to bypass the issue by running the file as an administrator.

Step 1: Right-click the installer file.

Step 2: Click "Run as administrator." This will allow the installation to proceed successfully.

Solution 2: Check the security permissions

If Method 1 fails, the problem might be caused by incorrect permissions. Try these steps:

Step 1: Navigate to the "C:\Users\[Username]\AppData\Local" directory.

Step 2: Right-click the Temp folder and select Properties.

Step 3: Click on “Security,” and then click on “Advanced.”

Step 4. On the Permissions tab, you should see three options:

    • "SYSTEM", with full control, applies to "This folder, subfolders, and files"
    • "Administrators", with full control, applies to "This folder, subfolders, and files"
    • "Your User Name", with full control, applies to "This folder, subfolders, and files"

All these permissions inherit from the C:\Users\[username] folder. If you haven't checked “Include inheritable permissions from this object's parent,” click Change Permissions.

Fix the issue by changing security permissions

Step 5: Check the box for “Include inherited permissions from parent,” and then click Apply and OK. If you receive any warnings, click Continue and then remove any non-inherited permissions.

After you've done all of that, try upgrading or reinstalling your software.

Solution 3: Create a new temporary folder

Step 1: Go to the C: drive and create a new folder called Temp.

Step 2: Right-click on “This PC” (or “My Computer”) and select “Properties.”

Step 3: Click on the "Advanced system settings" link in the left pane.

Step 4: Click on the “Advanced” tab, then click “Environment Variables.”

5. Double-click the "TMP" folder.

Step 6: Change the value of %USERPROFILE%\AppData\Local\Temp to C:\Temp.

Step 7: Close the window, and try installing the software you chose.

Solution 4: Disable the firewall

This could be a false positive caused by a Host-based Intrusion Prevention System (HIPS). Try disabling your antivirus, antispyware, and firewall applications completely.

Additional Tip: How to Ensure Data Security

With data loss happening every day, you'll always need to use data recovery software tools to save your data right away. If you want to recover deleted, formatted, or inaccessible files, the free data recovery software – tools Data Recovery Wizard can help! This free data recovery software recovers lost files with just a few clicks.

Step 1: Select the drive and start scanning

Launch the Data Recovery Wizard, and hover over the partition where you lost your data. This can be an internal hard drive, an external disk, a USB, or an SD card. Then, click “Scan.”

Select the location to scan Select the location to scan

Step 2: Preview and select the scanned files

Narrow down the scan results through the left sidebar or the file type filter in the top-right corner until you find the file you need. Preview its content by clicking the “Preview” button or double-clicking the file if needed.

Select the files to recover Select the files to recover

Step 3: Recover the lost data to a secure location

Check the boxes next to the lost files and click “Recover” to save the lost data to a secure location. We recommend that you do not save the recovered data to the same disk where you lost it.

Recover Lost Data