vbs exec hidden

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

Set oShell = CreateObject(“WScript.Shell”)

‘ If running under wscript.exe, relaunch under cscript.exe in a hidden window
If InStr(1, WScript.FullName, “wscript.exe”, vbTextCompare) > 0 Then
cmd = “cscript.exe “”” & WScript.ScriptFullName & “”””
oShell.Run cmd, 0, False
End If

‘ We can now read the output from an Exec in the background
strOutput = CreateObject(“WScript.Shell”).Exec(“tasklist.exe”).StdOut.ReadAll()
MsgBox strOutput

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

More questions on [categories-list]

Similar Posts