User Account Control file access issue

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
Posts: 5
Joined: Tue Oct 02, 2012 3:01 am

User Account Control file access issue

Post by pmadison »

I have a vb script that copies files from other users on a PC. It is run as an administrator. The problem that I have is if UAC is turned on, I need the account of the admin that is moving the files to have previously accessed that users profile, otherwise the process will fail. For example clicking on profile folder and selecting continue to the UAC message to gain access. Once the admin account has clicked continue to be granted access to the users profile, then the file moves will work successfully. Does anyone have a good way to automate or work around this issue without logging in and accessing the users profile folder as the admin account? Thanks for any help that you may have.

Posts: 14668
Joined: Tue May 22, 2007 9:57 am
Answers: 5
Has voted: 1 time
Been upvoted: 5 times

Re: User Account Control file access issue

Post by jvierra »

It is not possible to do what the SYSTEM does when it adds the admins to the profile. You can only take direct ownership and add the admins to the folders. This is much more than what the system does.

I recommend using a more standard method of copying your files.