John Darby
asked on
CMD shell elevation.js
Greetings,
I have a CMD which calls elevate.js to see if an elevated privilege is required for script execution. Can you help me understand how this works?
CMD script -->
<code>
@echo off
ECHO Checking if elevation is required to collect all logs...
IF X%1==XNoPause goto SkipElevation
cscript %~dp0\elevate.js %~dp0\Logging_Elevated.cmd
goto EOF
:SkipElevation
call %~dp0\Logging_Elevated.cmd %1 %2
:EOF
</code>
Thank you,
JohnD
elevate.js
I have a CMD which calls elevate.js to see if an elevated privilege is required for script execution. Can you help me understand how this works?
CMD script -->
<code>
@echo off
ECHO Checking if elevation is required to collect all logs...
IF X%1==XNoPause goto SkipElevation
cscript %~dp0\elevate.js %~dp0\Logging_Elevated.cmd
goto EOF
:SkipElevation
call %~dp0\Logging_Elevated.cmd
:EOF
</code>
Thank you,
JohnD
elevate.js
ASKER
Is the argument NoPause related to the OS asking for elevation?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!
Open in new window
If the argument NoPause was not passed to this file, then jumps to :SkipElevation
Open in new window
Run the Windows VBScript command processor, passing the elevate.js to it.
Open in new window