I am trying to run a VBScript which opens a program with elevated privileges and also pass it parameters.
Set oShell = CreateObject("Shell.Application")
Dim path = "app.exe"
If WScript.Arguments.Count = 1 Then
path = path & WScript.Arguments(0)
End If
oShell.ShellExecute path, , , "runas", 1
I get an error in the 2nd line. I tried using As String but that also didn't work.
Any ideas?