• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

Copy file as administrator

Hi,
I have a program that needs to copy a file to the startup of another computer.
I want to use the Administartor rights for that.
How do I program it to do it (I will provide the username and password)?

0
VapiSoft
Asked:
VapiSoft
1 Solution
 
alb66Commented:
You can use LogonUser(), DuplicateTokenEx() and ImpersonateLoggedOnUser() in order to impersonate a different user.

You can use CreateProcessWithLogonW() in order to start a new process as a different user
0
 
VapiSoftAuthor Commented:
Thank you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now