#1
|
|||
|
|||
Need to restart build elevated with all arguments
I am trying to automate a Visual Build Pro process (that I inherited) that must run elevated, and has some VBScript to restart it as elevated if it determines that it's not.
If I double-click on the .bld file, I get two VBP windows: the first is unelevated that promptly completes; the second is elevated, so clicking the green arrow sends everything off fine. I don't get a dialog asking me if I want to allow this program to run or make modifications to the system. If I right-click > "Run As Administrator", I get just the one elevated window, and all is well. OS: Windows 10 I have a command-line script with needed arguments that works if I run it in a "Run as Administrator" Command or PowerShell window. But when I run the script from the command line (PowerShell or Command) or from Jenkins via PowerShell or batch, I get two problems: 1. "Error building application: Build already in progress" I think this is because of the attempted restart as elevated, but the original command should have completed, so no build should have been in progress. I have looked all over this site and the web trying to find out what causes this, and have found nothing. 2. The VBScript uses the following to restart as elevated ("IsElevated" is a macro that the script uses): Set objShell = CreateObject("Shell.Application")The result seems to be that an elevated GUI is launched, and without the other arguments that I had in the command line, including macro definitions. I would like the command line to be re-launched elevated. Or is there a way that I can force the command line to run elevated (remember, I want to do this in Jenkins)? My account has some administrator privileges. E.g., in Task Manager, I can modify the Logon properties of services. And whether running VBP or Task Manager from the GUI, I don't get the dialog asking me for permission to run the process. But for some reason, it's not "elevated". Is there a simple command-line check to see whether my account is elevated? I also note in the same VBScript part of the .bld after the above (the Property keys should not have an embedded space, but Preview puts a space in there ): 'clear out the current project and set it up to log an informational message I have tried to find anything about "pausebefore", but no luck. I find that if I increase the value, it only delays the message appearing in the unelevated GUI. Note: for security reasons, that system is not connected to the Internet, and installing a program goes through a lot of hurdles. |
Tags |
command , elevated , re-launch |
Thread Tools | |
Display Modes | Rate This Thread |
|
|