Running a program from within a VBS script with variables
I am trying to get a script to run that looks at a file version number on the PC and sees if it's up to date. If it is then it does nothing if it isnt then it runs a program. The problem is that i can get it to run the exe file but I can't get it to run the exe file with the parameters needed.
PS, My coding-fu is weak.
So Far I've got:
(The message boxes are for testing purposes)
'Sets the value of the variable FilePath
FilePath = "C:\Program Files\<program>\<local.exe>"
Set fso = CreateObject("scripting.filesystemobject")
Set wshShell = WScript.CreateObject ("WSCript.shell")
FileNumber = fso.GetFileVersion (filepath)
if(FileNumber = "x.x.x") then
msgbox "File Verson Up to Date"
msgbox "Install Run"
This seems to work OK however I can't seem to get it work with the variables.
From the start menu I can easilly run
\\<server>\<share>\exe /Variable1 /variable2
Help? And whislt I am at it is there a way to make the script stop only when the exe has finished running?