/build/static/layout/Breadcrumb_cap_w.png

how to write setlang.vbs

  1. Hi, 
  2. Download the .vbs script from here: setlang.vbs and don't know how to write it, & when i try to run from command i am getting below error. Please help me to solve this problem 
  3. C:\Users\roopesh\Desktop\setlang.vbs(4, 32) Microsoft VBScript compilation error: Expected end of statement.
  4. here is the setlan.vbs file content copied for your reference. please correct if i am wrong.
  5. Dim argCount : argCount = Wscript.Arguments.Count
  6. If (argCount < 2) Then
  7. Wscript.Echo "setlang.vbs - Modify the package language field of an MSI installer file" & vbNewLine & vbNewLine & _
  8. "usage: cscript setlang.vbs "c:\Users\roopesh\Desktop\ampagent-5.4.10622-86_srvdc01.aosmithindia.com.msi 1033" & vbNewLine & vbNewLine & _
  9. "example: cscript setlang.vbs C:\temp\ampagent-5.4.1000-x86.msi 1033" & vbNewLine & vbNewLine & _
  10. "Copyright (C) 2012 Dell Inc.  All rights reserved."
  11. Wscript.Quit 1
  12. End If

  13. Dim dbPath : dbPath = Wscript.Arguments(0)
  14. Dim lcid : lcid = Wscript.Arguments(1)

  15. On Error Resume Next
  16. Dim installer : Set installer = Nothing
  17. Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError
  18. Dim database : Set database = installer.OpenDatabase(dbPath, 1) : CheckError
  19. Dim sumInfo : Set sumInfo = database.SummaryInformation(1) : CheckError
  20. Dim template : template = sumInfo.Property(7) : CheckError
  21. Dim iDelim : iDelim = InStr(1, template, ";", vbTextCompare)
  22. Dim platform : If iDelim = 0 Then platform = ";" Else platform = Left(template, iDelim)
  23. sumInfo.Property(7) = platform & lcid
  24. sumInfo.Persist : CheckError
  25. database.Commit : CheckError
  26. Set database = nothing
  27. Wscript.Echo "Successfully set package language = " & lcid
  28. Wscript.Quit 0

  29. Sub CheckError
  30. Dim msg, errRec
  31. If Err = 0 Then Exit Sub
  32. msg = Err.Source & " " & Hex(Err) & ": " & Err.Description
  33. If Not installer Is Nothing Then
  34. Set errRec = installer.LastErrorRecord
  35. If Not errRec Is Nothing Then msg = msg & vbNewLine & errRec.FormatText
  36. End If
  37. Wscript.Echo msg
  38. Wscript.Quit 2
  39. End Sub




0 Comments   [ + ] Show comments

Answers (1)

Posted by: LBarclay 9 years ago
Orange Senior Belt
0
I'm not quite sure what your trying to do as the question is a little vague, but you need to righ-click on the .vbs and choose "Edit" This will allow you to change the VBS for the KACE agent as explained in the instruction. 

Does that help? If not could you add a bit more information and restructure the question?

Thanks!
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ