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.
This topic is 7 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
pmadison
Posts: 5
Last visit: Tue Mar 10, 2020 1:32 pm

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.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 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.
This topic is 7 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked