Run command prompt as administrator

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Run command prompt as administrator

Post by kpassaur » Sat Dec 04, 2021 9:49 pm

Hopefully I will explain this well.

I have a compiled script that works on some machines and not on others. The portion that fails is the execution of a command line program. "This has worked for years with the RunProgram>"path and executable" options etc"

Since it is a command line program I have also executed with RunProgram cmd /c "and then the full path, executable and finally switches". This works on some machines and not others as well.

Now if I take the command line and run the Command Prompt as an administrator it works. If I put it in a bat file if fails. So, it only works if the Command Prompt is loaded as an administrator. Keep in mind the user is also an administrator. So what I am really looking for is how to access the command prompt as an administrator.

User avatar
Grovkillen
Automation Wizard
Posts: 1128
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Run command prompt as administrator

Post by Grovkillen » Sun Dec 05, 2021 12:27 pm

viewtopic.php?f=9&t=10606

You can do the same with any exe file.
Let>ME=%Script%

Running: 15.0.27
version history

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts