Unable to execute file in the temporary directory error Fix

If you are receiving an error message while trying to run an installer on your system, stating ‘Unable to execute file in temporary directory’ error message, you are not alone. Some other Windows 10 users are also complaining about this issue in multiple Windows 10 forums. This error sometimes occurs due to misconfigured permission of some specified folders on your system. Just follow these easy steps to fix the issue on your computer.

Workarounds 

1. Restart the system once and check again.

2. Disable the antivirus program temporarily. Try further.

If none of these quick tricks helps you out, follow these fixes

Fix 1 – Create a new Temp folder

This problem is pretty common in the case of a corrupted Temp folder on your device.

1. Press the Windows key+E.

2. Then, go to the “Local Disk (C:)” on the left-hand side.

 

Local Disk C Min

 

3. On the right-hand side, right-click on the “New>” and then click on “Folder“.

4. Name this folder as “Temp“.

 

New Folder Temp Min



 

Close the File Explorer window.

5. Right-click on the Windows icon and click on the “Run“.

6. After that, type “sysdm.cpl” and click on “OK“.

 

Run Command Sysdm.cpl Ok

 

7. Once the System Properties opens up, go to the “Advanced” tab.

8. Then, click on “Environmental variables“.

 

Enviromental Variables Min

 

9. In the ‘User variables’ section you will notice the variable ‘TMP‘.

10. Double click on it to modify it.

 

Tmp Dc Min

 

11. Here, paste this location in the ‘Variable value’ box.

C:\Temp

12. Thereafter, click on “OK” to save the changes.

 

C Temp Value Min

 

After this, check if the problem is still there or not.

 

Fix 2 – Modify the Permission of the temp folder

You can modify the permission of the Temp folder so that every user has enough permission over it.

1. Press the Windows key+R to launch a Run window.

2. After that, paste this location and click on “OK“.

C:\Users\%username%\AppData\Local

 

Temp Location Run Local Min

 

3. When the Local folder opens up, find out the Temp folder.

4. Right-click on the “Temp” folder and click on “Properties” to access it.

 

Temp Props Min

 

5. Simply, click on “Edit” to modify the permissions.

 

Security Edit Min

 

5. Here, look out for the “Everyone*. Select the group.

6. After that, check the “Allow” box of ‘Full control‘ permission.

This will give every user full control of this file.

 

Full Control For Every1 Min

 

7. Then, click on “Apply“. After that, click on “OK“.

 

Apply Ok Min

 

8. What you need to do is to click on “Apply“.

9. Then on “OK“.

 

Apply Ok Min

 

*NOTE

There is a chance you won’t notice ‘Everyone’ in the permission entries. Simply follow these steps to add the ‘Everyone’ group.

1. Once you have opened the Properties window, click on the “Add“.

 

Add Min

 

2. Next you need to write “Everyone” in the ‘Enter the object name to select:’ box.

3. Just once click on “Check Names” to perform a check the authenticity.

4. Finally, click on “OK“.

 

Everyone Min

 

5. Click on “Apply” to save it.

6. If you see a warning message, simply click on “OK“.

 

Ok Min

 

7. Just click on “Apply” and “OK” to save this change.

 

Apply Ok Min

 

 

Once you have done this, try to run the installer or get access to the problematic folder location.

 

Fix 3 – Modify advanced permissions of Temp

If giving permission to everyone didn’t work out for you, try these steps.

1. Press the Windows key+E keys together.

2. After that, go to this location –

C:\Users\%username%\AppData\Local

 

Temp Location Run Local Min

 

3. Just like before, right-click on the “Temp” and click on “Properties“.

 

Temp Props Min

 

4. After that, go to the “Security” tab.

5. Next, click on the “Advanced“.

 

Advanced Security Min

 

6. In the Advanced Security Settings windows, check the box “Include inheritable permissions from the object’s parent“.

7. Click on “Apply” and “OK” to save the change.

 

Apply Ok Min

 

This should do the trick for you.

 

Fix 4 – Set the exe to run as an administrator

Try to run the executable file as an administrator.

1. Go to the problematic file/folder location.

2. Right-click on the executable and then click on “Properties“.



 

Application With Error Right Click Properties

 

3. Once the Properties window opens up, go to the “Compatibility” tab.

4. To run executable files as an administrator, just check the option “Run as administrator“.

 

Run This Program As Admin Min

 

5. Don’t forget to click on “Apply” and “OK“.

 

Apply Ok Min

 

Once you have done this, try to run the application/ installer again.

 

Fix 4 – Run some scans

1. You need to press the Windows key+R keys together.

2. Then, type this code and hit Ctrl+Shift+Enter keys together.

cmd

 

Run Command Cmd Ctrl + Shift + Enter

 

3. Paste this code in the terminal. Thereafter, hit Enter to run the scan.

sfc /scannow

 



2 Sfc Scan Now

 

SFC scan will commence.

4. To launch a DISM scan, paste this command in the terminal and then hit Enter.

DISM.exe /Online /Cleanup-image /Restorehealth

 

Command Prompt (admin) Run Dism Command Enter

 

Your problem will be solved for sure.