I'm trying to open a command prompt as Administrator AND run a .VBS file using CScript.
I found post for running cmd as Administrator:
Shell "powershell.exe -Command " & Chr(34) & "Start-Process cmd -Verb RunAs", vbNormalFocus
Also Found a post for running a VBS file:
SFilename = "Cscript " & Chr(34) & "C:\Temp\Run.vbs " & Chr(34) & " " & pParam1 & " " & pParam2
Shell SFilename, vbNormalFocus
However, Can someone help me to get both things done in single cmd window?
I tried merging both Shell statments and running one after the other but no luck.
Set oShell = CreateObject("Shell.Application"): oShell.ShellExecute "cscript.exe", "//nologo c:temp\run.vbs", , "runas", 1
change to for cmdoShell.ShellExecute "cmd.exe", "/k cscript //nologo c:temp\run.vbs", , "runas", 1
– user6017774