Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a mapped network drive (to samba on local network) and when I try to copy a file from it to Program Files or other "secure" folders UAC pops up I confirm, and it still gives me access denied.

The workaround I'm using: I first copy the file to "unsecure" folder like Desktop and then copy it to Program Files. Still asks for UAC, but works.

Is there a way to disable this behaviour?


I'm a developer and I have specific reason to copy to Program Files. Also I don't want to turn off UAC. If you read correctly I want to disable "Access denied" message after I click yes to the UAC prompt.

Consider the circumstances:

  • This happens when copying from network mapped drive
  • When copying to Program files
  • Copying from Desktop to Program Files works (after confirming UAC prompt)
share|improve this question
you don't have to be so hostile, a simple explanation as to why certain actions are not possible is sufficient. – Sathya Jul 25 '11 at 10:47
Sorry, but 2 answers were already telling me to turn off UAC. – Kugel Jul 25 '11 at 14:27
As a fellow developer I understand your pain. I needed to resolve a similar case back when Vista and UAC first came along. My advice is that you really really reconsider writing in Program Files. You are basically fighting against Microsofts security intentions. I found a solution that worked, and it broke a few security updates later. So in the end I gave in and modified my application to use the recommended place to store the files I needed to muck about with. C:\Users\Default\AppData – Nifle Jul 25 '11 at 14:41
This is not done programmatically, I would never do that to a user PC. This is a manual thing I do when deploying a debug version of a plug-in. It was just annoying hence the question. – Kugel Jul 25 '11 at 16:27
Check this out this Microsoft KB This should be exactly what you're looking for. Also, this question should be marked as a duplicate of, or at least linked somehow. – cmorse Nov 1 '11 at 16:10
up vote 1 down vote accepted

Disabling UAC is not enough.

You need to disable Admin Approval Mode (requires restart). More details here (option B, last screen shot):

This worked for me and now I can work w/ files and folders from Program Files w/o any more UAC prompts.

share|improve this answer

Instead of disabling UAC - you can achieve exactly what you want by disabling the LocalAccountTokenFilter, which is what strips the admin token from all incoming network connections.

I run this on my own network and get full control over the remote shares.

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Value: LocalAccountTokenFilterPolicy
Data: 1 (to disable, 0 enables filtering)
Type: REG_DWORD (32-bit)
share|improve this answer

If you must, take ownership of the Program Files folder (and subfolders). After taking ownership, give the Administrators group full permissions (realize, however, that this will open you up to security issues such as malware).

To do so:

  1. Go to > Start > All Programs > Accessories

  2. Right-click on Command Prompt, and then click Run as Administrator.

  3. Type the following command and press Enter:

    takeown /f [path to folder] /r /d y
  4. To assign the Administrators group Full Control Permissions for the folder, use this command and hit Enter:

    icacls [path to folder] /grant administrators:F /T
share|improve this answer
In addition to what Moab mentions also make sure the destination folder(s) are not marked as 'read only'. All those 3 steps in tandem provide full access correctly. – user135548 May 22 '12 at 10:45
Also make sure the destination folder(s) are not marked as 'read only'. All those 3 steps in tandem provide full access correctly. – Oliver Salzburg May 22 '12 at 10:48

You can disable the UAC feature:

  1. Go to: Control Panel > User Accounts and Family Safety > User Accounts
  2. Select "Change user account control settings"
  3. Scroll the trackbar to never notify and click OK
share|improve this answer
I'm sorry but I'm not asking to disable UAC, and I don't think this is UAC causing it. – Kugel Jul 15 '11 at 10:03

You must log in to answer this question.

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