Jump to content

Ok so I keep getting a syntax error when trying to add a line to this


Recommended Posts

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 application

MyApp = """C:\MyApplication\Setup.exe"" /Q"

i = 0

i = 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 MyApp

Setup.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


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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...