vbs run with cscript

The solution for “vbs run with cscript” can be found here. The following code will assist you in solving the problem.

Set oShell = CreateObject(“WScript.Shell”)

If Not LCase(Right(WScript.FullName, 12)) = “\cscript.exe” Then
For Each Arg In WScript.Arguments
If InStr(Arg, ” “) Then Arg = “””” & Arg & “”””
Str = Str & ” ” & Arg
Next
cmd = “cscript //nologo “”” & WScript.ScriptFullName & “”” ” & Str
oShell.Run cmd, 0, false
WScript.Quit
End If

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts