You are not logged in.
Pages: 1
Invisible.vbs (ss64.com/vb/run.html)
This one line VBScript can be used to run a command in an invisible window:
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
' An example running 'Demo.cmd' with invisible.vbs
wscript.exe "invisible.vbs" "demo.cmd" //nologo
Can I use arguments on demo.cmd (demo.cmd arg1)?
Offline
Yes, but not with that VBS script.
By using the following code for Invisible.vbs,
Dim Args()
ReDim Args(WScript.Arguments.Count - 1)
For i = 0 To WScript.Arguments.Count - 1
Args(i) = """" & WScript.Arguments(i) & """"
Next
CreateObject("WScript.Shell").Run Join(Args), 0, False
You may pass arguments to “demo.cmd” like so:
wscript.exe //nologo "invisible.vbs" "demo.cmd" arg1 arg2...
Last edited by Pyprohly (17 Sep 2017 08:33)
Offline
Thank you!
Offline
Pages: 1