Page 1 of 1

Execute .vbs files?

Posted: Thu Dec 04, 2014 3:39 am
by aceallways
Hi guys,

So I finally got Execute working with .bat files, but I want no command window so I was going to have a .vbs pass the parameters on to a .bat.

This is my vbs file:

Code: Select all

Set oShell = CreateObject ("Wscript.Shell") 
Set args = WScript.Arguments
Dim strArgs
Dim path
path = """C:\Program Files (x86)\Deluge\test.bat"""
strArgs = path&" "&args(0)&" "&args(1)&" "&args(2)
WScript.Echo(strArgs)
oShell.Run strArgs, 0, false
For some reason there is no result though. I have the Echo in there so I would be able to tell if the vbs was running, nothing ever shows up.

Does Execute not support vbs for some reason?

Re: Execute .vbs files?

Posted: Thu Dec 04, 2014 10:47 am
by Cas
It's not possible with vbs because it need to be called with `cscript`. However one workaround would be to convert it to an exe file: http://www.f2ko.de/programs.php?lang=en&pid=ov2e (On Windows 8 you will need to unblock the exe in properties.)