Unable To Execute File in the Temporary Directory Error 5 Fixed

Reading time icon 8 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

Unable To Execute File in the Temporary Directory Error 5
A message from our partner

Resolve multiple Windows PC issues and speed up your PC effortlessly with specialized software.

  • Download HelpSoft PC Cleaner and install it on your PC.
  • Click on Start Scan button to find corrupt or broken files that affect your PC.
  • Now the software will start the fixing process and boost your PC performance.
Download now HelpSoft PC Cleaner has been downloaded by 0 readers this month

Did you get a pop-up saying “Unable to execute file in the temporary directory. Error 5: Access is denied.”?

This issue is related to the Windows InstallShield tool and temporary folders on the Windows installation drive. It’s primarily the C: drive. Sometimes, the InstallShield wizard can’t unpack the content of the installation package, and you’ll get this error message.

Unable To Execute File in the Temporary Directory Error 5

It usually happens for the following reasons:

  • The active user account doesn’t have admin rights to install certain apps.
  • Hard drive or SSD malfunction prevents creating new directories or writing to existing folders.
  • Someone has modified folder security rights so your user account can’t write data.
  • InstallShield wizard can’t locate or use the default TEMP folder in the C: drive.
  • PC is infected with malware.
  • Antivirus is aggressively blocking apps, including the InstallShield wizard.
  • Windows 10/11 Firewall is blocking the rewriting of content in the TEMP folders.

To help you fix the issue, I’ve reproduced this error on a Windows 10 PC. Here are the solutions that worked for me!

How To Fix Unable To Execute File in the Temporary Directory Error 5

Here are some techniques to try, starting with the simplest. Follow this order for the quickest and best results:

Log On as an Administrator

  1. Click on the Start menu button and then on your user profile picture in the bottom right corner.
  2. A context menu will show up. Select Sign out.
user account
  1. Wait for your computer to return to the login screen.
  2. If you see more than one user account, click on the one that’s the Administrator account.
  3. You might need to contact the device owner or IT support personnel if you don’t know which admin account to use.
  4. Enter the required credentials in the User name and Password fields.
  5. Hit Enter to log on as an administrator.

Now, try installing the app again.

Run Installer as Administrator

If you’re already logged in to the Windows PC as an administrator, try the following instead:

  1. Locate the installer package, select it, and right-click.
  2. Click on the Run as administrator from the context menu.
fix Unable To Execute File in the Temporary Directory Error 5
  1. The InstallShield wizard of the software package will now gain privileged access to read and write storage drives and directories.

Set Full Control for the Temp Folder

  1. Navigate to the following location to find the Temp folder used by the InstallShield wizard.
C:\Users\CtOS\AppData\Local
  1. Replace CtOS with your user account name.
  2. Locate the Temp folder and right-click on it.
  3. Select Properties from the context menu.
right click temp
  1. The Temp Properties dialog box will show up.
  2. Navigate to the Security tab.
  3. Select your user account in the Group or user names section.
  4. In the Permissions for section, look for given accesses below the Allow column.
  5. If it looks like the image below, the selected user account doesn’t have enough permission to use this folder.
  6. Click on the Edit button.
temp properties edit
  1. The Permissions for Temp dialog will open.
  2. Again select your user account.
  3. Checkmark the boxes for all the items below the Allow column.
  4. Click Apply and OK to enforce the changes.
permissions for temp allow
  1. Again, click Apply and OK on the Temp Properties dialog box.

This should help you fix the “Unable To Execute File in the Temporary Directory Error 5” problem when installing software.

Clear the Temporary Files

Navigate to the following Temp folders in your Windows PC and delete all the content inside these directories.

Try to erase as many temporary files as you can from them:

C:\Windows\Temp
temnp 1
C:\Users\CtOS\AppData\Local\Temp
temp 2

In the above Temp directory address, replace CtOS with your user account name.

You’ll need administrator access to delete the content of these Temp folders.

Create a New Default TEMP Folder

  1. Go to the Windows installation drive and create a new folder named TEMP.
create new temp
  1. Press the Windows + R keys to open the Run dialog.
  2. Type sysdm.cpl in the Open field and press Enter.
run dialog
  1. In the System Properties window, go to the Advanced tab.
  2. Click on the Environment Variables option.
Environment Variables
  1. Under User variables for CtOS, click New.
  2. In place of CtOS, you’ll see your user account name.
User variables for CtOS
  1. For the Variable name field, enter TEMP.
  2. In the Variable value field, enter the full path to your new Temp folder as shown below:
C:\TEMP
  1. Click OK.
  2. Click OK again to close all windows.
variables

Run Disk Cleanup

  1. Type Disk Cleanup in the Start menu.
  2. Click on the Disk Cleanup app below the Best match section.
Disk Cleanup
  1. You’ll see the Disk Cleanup: Drive Selection dialog box.
  2. Ensure, the Windows installation drive is selected there. For example, (C:\).
Disk Cleanup Drive Selection
  1. You’ll now see the Disk Cleanup for WINDOWS 10 dialog box.
  2. In place of WINDOWS 10, you might see Local Disk C: or any other name you’ve assigned to the Windows installation folder.
  3. Click on the Clean up system files button.
Clean up system files
  1. Again, you’ll see the Disk Cleanup: Drive Selection pop-up.
Disk Cleanup Drive Selection 2
  1. Select the same drive again.
  2. Windows will delete unnecessary system files.
  3. When the Disk Cleanup for WINDOWS 10 dialog shows, click on the OK button.
clean up disk
  1. You’ll now see the Disk Cleanup progress bar.
disk clean up progress

Once you’ve cleaned the C: drive, try to install the app again.

Turn User Account Control Off

  1. Click on the Start menu button.
  2. Type User Account Control.
  3. Select the Change User Account Control settings below the Best match.
Change User Account Control settings
  1. You’ll now see the User Account Control Settings dialog box.
  2. Usually, it should be on the Always notify side.
Always notify
  1. Slide it down to the Never notify level.
  2. Click OK.
  1. You might need to approve the action by clicking Yes or Continue on a confirmation dialog.

Test if the issue has been fixed or not. Follow the steps mentioned above to revert the User Account Control level to Always notify.

Perform a Clean Boot

  1. Press the Windows and R keys together to open the Run dialog box.
  2. Type msconfig in the Open field and hit Enter.
run msconfig
  1. In the System Configuration window, click on the Services tab.
  2. Check the box next to Hide all Microsoft services.
  3. Click Disable all.
disable thirdparty services
  1. Click on the Startup tab.
  2. Click Open Task Manager.
  3. In the Task Manager, go to the Startup tab.
  4. For each startup item, right-click on it and select Disable.
  5. Close the Task Manager.
disable startup tasks
  1. In the System Configuration window, click Apply and then OK.
  2. Restart your PC.

Test if the issue is fixed or not. Once you’re able to install the new app, follow these steps again to enable non-Microsoft services and startup services from Task Manager. Reboot your PC to enforce these changes.

Create a New Administrator Account

  1. Press the Windows + R keys to open the Settings app.
  2. Click on the Accounts menu in the list.
  3. You’ll see the Settings > Your info menu.
  4. Click on the Family & other users option in the left-side navigation panel.
Family & other users
  1. Select the Add someone else to this PC button below the Other users section on the right.
  2. A Microsoft account sign-in dialog will open. Click on the I don’t have this… hyperlink.
I don't have this...
  1. Select Add a user without a Microsoft account on the next screen.
  2. Enter the necessary details on the Create a user for this PC dialog and click Next.
Create a user for this PC
  1. You should see the newly created account in the Other users section.
  2. Click on that and hit the Change account type button.
Change account type
  1. You’ll see the Change account type dialog.
  2. Click on the Account type drop-down menu and choose Administrator.
  3. Hit OK to apply the modification you just made.
Change account type dialog
  1. Now, log out of the existing Windows user account and log in with the new Admin account.

You should now try to install the new app and see if the “Unable To Execute File in the Temporary Directory Error 5” issue is fixed.

Disable the Antivirus Program Briefly

  1. Open the Windows Settings by pressing the Windows + I keys together and click on the Update & Security option.
  2. On the Update & Security menu, click on the Windows Security option.
Windows Security
  1. Click on the Virus & threat protection setting below the Protection areas section on the right.
Virus & threat protection
  1. Select Manage settings below the Virus & threat protection settings.
Manage settings
  1. Use the toggle button to disable the Real-time protection feature.
Real-time protection
  1. Keep this window as is.
  2. Try to install the new app.
  3. If it works, use the Real-time protection toggle button again to activate the security feature.

Reboot Windows Into Safe Mode

  1. Click on the Start menu and select the Power button.
  2. A context menu with three power options will show up.
  3. Press the Shift key on the keyboard and click on the Restart button.
  4. The Windows PC will restart and boot into the WinRE environment.
  5. Click Troubleshoot.
troubleshoot 2
  1. Select Advanced options in the Troubleshoot screen.
advanced options 3
  1. Click on the Startup Settings.
Startup settings 4
  1. Select Restart on the next screen.
Restart 5
  1. The PC will reboot to the Startup Settings menu with several options.
  2. There, press the numeric 4 key for Safe Mode.
press 4 for safe mode
  1. The PC will reboot into Safe Mode.
safe mode

Now, check if Error 5 surfaces again when you try to install an app.

Summary

So, these are the fixes you can follow to overcome the Unable to execute file in the temporary directory Error 5 when installing apps. These methods will work effectively on Windows 7, 8, 11, etc.

You might also want to check out You have been denied permission to access this folder and Folder access denied Windows 11 if you face any of these issues.

More about the topics: windows 10, Windows 11

User forum

0 messages