|A non-elevated prompt creating an elevated prompt|
PowerShell, on the other hand, labors under no such restrictions, thanks to the Start-Process cmdlet.
As luck would have it, Start-Process includes a -Verb argument, which accepts the following:
File type Verbs
.cmd------Edit, Open, Print, Runas
.txt------Open, Print, PrintTo
If you feed it the Runas flag, PowerShell will dutifully run whatever process you feed it with an administrative prompt. Consequently, if you feed powershell.exe the following within CMD:
powershell.exe -Command "Start-Process cmd.exe -Verb RunAs"
You'll end up with an administrative CMD prompt.
I find that just prepending existing CMD scripts withReplyDelete