clivebuckwheat Posted February 13, 2012 Share Posted February 13, 2012 Hi guys need some help debugging this code. I am trying to install some software from a VBS script in order to suppress the exit code. I found this script on the web.'*******************************************Dim oShell, MyApp, i Set oShell = CreateObject("WScript.Shell")' MyApp is the application path with silent switch.' Use appropriate silent switches as per the applicationMyApp = """C:\MyApplication\Setup.exe"" /Q"i = 0i = oShell.Run(MyApp, 1 ,True)WScript.Echo "Exit Code is: " & (i)'Uncomment the following line of code while using this script in software delivery and comment the above line'WScript.Quit(i)Set oShell = Nothing'*******************End Of Code**************I would like to add the following to the script for MyAppSetup.exe /UL1033 /V"SERIALNUMBER=XXXX-XXXX-XXXX-XXXX-XXXX-XXXX" Every time I do I keep getting syntax errors, I am sure it is the quotes. Can you help out. Link to comment Share on other sites More sharing options...
gunsmokingman Posted February 14, 2012 Share Posted February 14, 2012 When I ran this as a test a selected cancel it return 2, give it a try on your computer after you change the app path and switches.Dim Act :Set Act = CreateObject("Wscript.Shell")Dim i,App'-> Chr(34) = " '-> App = Chr(34) & "Path\To\App" & Chr(34) & " /Switches" App = Chr(34) & "E:\App\audioextractor.exe" & Chr(34) & " /S" i = Act.Run(App,1,True) MsgBox "Exit Code is : " & (i),4128, "Install Exit Code" Link to comment Share on other sites More sharing options...
clivebuckwheat Posted February 17, 2012 Author Share Posted February 17, 2012 Thanks man worked like a champ. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now