Vbscript KACE setlang.vbs错误编译

Vbscript KACE setlang.vbs错误编译,vbscript,Vbscript,请帮助,我无法从cmd执行它,&错误为C:\setlang.vbs4,32 Microsoft VBScript编译错误:预期结束状态 梅蒂 请找出下面代码中的错误 Dim argCount : argCount = Wscript.Arguments.Count If (argCount < 2) Then Wscript.Echo "setlang.vbs - Modify the package language field of an MSI installer file"

请帮助,我无法从cmd执行它,&错误为C:\setlang.vbs4,32 Microsoft VBScript编译错误:预期结束状态 梅蒂

请找出下面代码中的错误

Dim argCount : argCount = Wscript.Arguments.Count
If (argCount < 2) Then
    Wscript.Echo "setlang.vbs - Modify the package language field of an MSI installer file" & vbNewLine & vbNewLine & _
        "usage: cscript setlang.vbs <msi_file_path> <lcid>" & vbNewLine & vbNewLine & _
        "example: cscript setlang.vbs C:\temp\ampagent-5.4.1000-x86.msi 1033" & vbNewLine & vbNewLine & _
        "Copyright (C) 2012 Dell Inc.  All rights reserved."
    Wscript.Quit 1
End If

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

On Error Resume Next
Dim installer : Set installer = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer") : CheckError
Dim database : Set database = installer.OpenDatabase(dbPath, 1) : CheckError
Dim sumInfo : Set sumInfo = database.SummaryInformation(1) : CheckError
Dim template : template = sumInfo.Property(7) : CheckError
Dim iDelim : iDelim = InStr(1, template, ";", vbTextCompare)
Dim platform : If iDelim = 0 Then platform = ";" Else platform = Left(template, iDelim)
sumInfo.Property(7) = platform & lcid
sumInfo.Persist : CheckError
database.Commit : CheckError
Set database = nothing
Wscript.Echo "Successfully set package language = " & lcid
Wscript.Quit 0

Sub CheckError
    Dim msg, errRec
    If Err = 0 Then Exit Sub
    msg = Err.Source & " " & Hex(Err) & ": " & Err.Description
    If Not installer Is Nothing Then
        Set errRec = installer.LastErrorRecord
        If Not errRec Is Nothing Then msg = msg & vbNewLine & errRec.FormatText
    End If
    Wscript.Echo msg
    Wscript.Quit 2
End Sub

您的代码在这里没有错误

如果文件中的间距与文章中的间距相同,则在第4行setlang.vbs中的点之前有一个CR

如果使用记事本书写,请复制并粘贴到写字板以检查换行。记事本完全忽略并隐藏回车符,但其他程序不会。记事本只查找换行。如果使用基于浏览器的文档(如网页和帮助系统)进行处理,则有时会在记事本中不可见地插入文件