MSFN Forum: Ok so I keep getting a syntax error when trying to add a line to this - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ok so I keep getting a syntax error when trying to add a line to this Rate Topic: -----

#1 User is offline   clivebuckwheat 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 562
  • Joined: 07-November 05

Posted 13 February 2012 - 05:59 PM

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.


#2 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,350
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 13 February 2012 - 10:25 PM

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"



#3 User is offline   clivebuckwheat 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 562
  • Joined: 07-November 05

Posted 17 February 2012 - 05:21 PM

Thanks man worked like a champ.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy