Hi I am having an issue passing parameters through a vbscript to a batch file. I am not very good at programming so I am sure I am just missing something stupid. Anyway I am using the vbscript to invisibly run the batch file
The vbscript is called as "C:\Program Files (x86)\scripts\check.vbs" %S "%D"
Where %S is state and %D is directory.
If I call the batch file directly as "C:\Program Files (x86)\scripts\checkdir.bat" %S "%D"
everything works fine except there is a dos windows that pops up which is annoying.
So I looked around the internet and found this vbscript that can run a batch file silently. It does in fact run it silently however it does not pass the parameters to the batch file.
Here is the vbscript:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Program Files (x86)\scripts\checkdir.bat" & Chr(34), 0
Set WshShell = Nothing
How would I go about passing the parameters? I have searched but I could not come up with anything that worked for me, I would either get an error on running it or the parameters would not pass.