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.
3. On the right-hand side, right-click on the “New>” and then click on “Folder“.
4. Name this folder as “Temp“.
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“.
7. Once the System Properties opens up, go to the “Advanced” tab.
8. Then, click on “Environmental variables“.
9. In the ‘User variables’ section you will notice the variable ‘TMP‘.
10. Double click on it to modify it.
11. Here, paste this location in the ‘Variable value’ box.
C:\Temp
12. Thereafter, click on “OK” to save the changes.
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
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.
5. Simply, click on “Edit” to modify the permissions.
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.
7. Then, click on “Apply“. After that, click on “OK“.
8. What you need to do is to click on “Apply“.
9. Then on “OK“.
*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“.
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“.
5. Click on “Apply” to save it.
6. If you see a warning message, simply click on “OK“.
7. Just click on “Apply” and “OK” to save this change.
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
3. Just like before, right-click on the “Temp” and click on “Properties“.
4. After that, go to the “Security” tab.
5. Next, click on the “Advanced“.
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.
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“.
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“.
5. Don’t forget to click on “Apply” and “OK“.
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
3. Paste this code in the terminal. Thereafter, hit Enter to run the scan.
sfc /scannow
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
Your problem will be solved for sure.