New
#20
You can use this below to add "Run as administrator" for VBS files. VBS runs with wscript.exe by default.
Add Run as administrator to Context Menu of VBS Files in Windows 10
You can use this below to add "Run as administrator" for VBS files. VBS runs with wscript.exe by default.
Add Run as administrator to Context Menu of VBS Files in Windows 10
Got it. Now I want to add "open with command prompt as admin" for vbs files too. Would I use a command like this?
cmd /c echo|set/p="%V"|powershell -NoP -W 1 -NonI -NoL "SaPs 'cmd' -Args '/c """cd /d',$([char]34+$Input+[char]34),'^&^& start /b %SystemRoot%\System32\CScript.exe" "%1" %"""' -Verb RunAs"
I'm not sure what the proper command is. VBSFiles by default have a right-click option to open with command prompt, "%SystemRoot%\System32\CScript.exe" "%1" %*. So what I want to do is create another option to open with admin command prompt. I cannot use the RunAs verb since it is already used. I am guessing some sort of powershell command but I am not sure.
Ok. Would you prefer a new thread in the Customization section or a follow up to this tutorial?
Add Run as administrator to Context Menu of VBS Files in Windows 10
Thanks!
Good evening @Brink. For the Open With PowerShell 5.1 as admin, how do you get rid of the following text that appears when the command is launched, to have only the directory path show? /k argument gets rid of the copyright for command and -nologo only works for PowerShell 7. Thanks!
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6