0

I first came across this error when trying to write a program in Java that executes a .EXE that is packaged within the .JAR. At first I thought the issue was related to my program, or Windows 7 in general but after testing on two other Windows 7 machines, I can conclude that it is specific to my laptop.

Basically, I get an access denied message whenever I try to execute a program in "C:\Users\Andy\AppData\Local\Temp", even though I am using an Administrator account. I have looked at the permissions for the folder and there are only entries for Andy, and the Administrator, neither of which are inherited. And the check box that says inherit permissions from parent directory is disabled, and not ticked.

Any ideas what may be going wrong?

UPDATE: I've just logged in to the Built-In Administrator account and given my account ownership of the folder (I couldn't do it from my account), and now I can execute programs now. However, I would be interested in why this would have happened and how else I could have solved the issue.

10
  • You need to adjust the permission on this folder. Try to take ownership of the folder.
    – Ramhound
    Sep 8, 2013 at 18:25
  • @Ramhound How would I take ownership of the folder?
    – Andy
    Sep 8, 2013 at 18:41
  • how you take ownership of a folder is well documented what have you tried?
    – Ramhound
    Sep 9, 2013 at 11:12
  • 1
    @Ramhound I used the reg file to add the 'Take Ownership' option to the context menu, and then used that option on the folder. If this is wrong, can you please tell me the right way?
    – Andy
    Sep 9, 2013 at 18:57
  • 1
    @Ramhound Surely even so I shouldn't have had to enable the hidden admin account to gain ownership though? I don't normally use registry hacks, and I'm sure that I haven't had a virus for a long time.
    – Andy
    Sep 10, 2013 at 8:43

3 Answers 3

6

There are some antivirus application that block execution from the temp folder. This is because this is a likely place for a virus to get downloaded into. The user has to explicitly move an executable out of the folder to run. It is an added layer of security.

2
  • Thanks for your answer, I like the idea but in this situation, antivirus programs weren't the issue here. Useful answer for others though, and I clearly need to add a backup fail-safe location, so +1
    – Andy
    Sep 12, 2013 at 19:01
  • 2
    McAfee has this feature. The "C:\ProgramData\McAfee\DesktopProtection\AccessProtectionLog.txt" might have entries like this: "11/14/2014 11:57:35 PM Blocked by Access Protection rule CORP\username C:\ETC\PROCEXP\PROCEXP.EXE C:\Users\username\AppData\Local\Temp\PROCEXP64.exe Anti-spyware Maximum Protection:Prevent all programs from running files from the Temp folder Action blocked : Execute" Nov 14, 2014 at 22:22
4

First of all, thank you to a @Ramhound for his helpful comments.

The issue was indeed due to ownership. However, the issue forced me to use the Built-In Administrator account in order to grant my 'standard' account ownership to the Temp folder. After that, everything worked fine.

0

I just saw the same thing on a Windows 8 computer. I suspect it may be that the ownership issue can happen if the user account being used is not the first account created on the machine. In my case the account being used is the second account created on this Windows 8 computer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .