Console program as Adminstrator
Posted: 16 Jun 2023 18:52
Hello. Trying to run Robocopy as a command line or within a batch file and wish to use robocopy's backup switch (/ B) wich requires administrative privileges.
Using this code:
The robocopy log reveals an error for lack of admin privileges.
I am using Windows 11 and signed in under an administrator account.
Are there any suggestions to "run" the useExe object as admin?
Thanks in advance.
Dave
Using this code:
Code: Select all
...
Command =
string::format(@[robocopy % % /e /b /mir /xo /im /np /LOG:Backup.log], SourceDir, DestinationDir),
RunObj = useExe::new(Command),
RunObj:run(),
...
I am using Windows 11 and signed in under an administrator account.
Are there any suggestions to "run" the useExe object as admin?
Thanks in advance.
Dave