Vbscript VBS登录脚本无法正常运行

Vbscript VBS登录脚本无法正常运行,vbscript,registry,Vbscript,Registry,我有一个登录脚本,用于检查注册表项,如果找不到注册表项,它将运行一个脚本,从AD中的信息创建outlook签名,然后向注册表添加一个注册表项。该脚本已经在我测试过的大约20台机器上完美运行,但是它在3台机器上无法正常工作。对于这3台机器,它通过了对注册表项的检查,然后启动sigcreate脚本,但跳过实际创建,只添加注册表项。我错过什么了吗 On Error Resume Next Set objSysInfo = CreateObject("ADSystemInfo") Set WshSh

我有一个登录脚本,用于检查注册表项,如果找不到注册表项,它将运行一个脚本,从AD中的信息创建outlook签名,然后向注册表添加一个注册表项。该脚本已经在我测试过的大约20台机器上完美运行,但是它在3台机器上无法正常工作。对于这3台机器,它通过了对注册表项的检查,然后启动sigcreate脚本,但跳过实际创建,只添加注册表项。我错过什么了吗

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")

Set WshShell = CreateObject("WScript.Shell")

strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)

strName = objUser.FullName
strTitle = objUser.Description
strCred = objUser.info
strStreet = objUser.StreetAddress
strLocation = objUser.l
strPostCode = objUser.PostalCode
strPhone = objUser.TelephoneNumber
strMobile = objUser.Mobile
strFax = objUser.FacsimileTelephoneNumber
strEmail = objUser.mail

Set objWord = CreateObject("Word.Application")

Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature

Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

objSelection.Font.Name = "Arial"
objSelection.Font.Size = 11
if (strCred) Then objSelection.TypeText strName & ", " & strCred Else 
objSelection.TypeText strName
objSelection.TypeParagraph()
objSelection.TypeText "   " & strTitle
objSelection.TypeText Chr(11)
objSelection.TypeText "    " & strPhone
objSelection.TypeText Chr(11)
objSelection.TypeText Chr(11)
objSelection.TypeText "Company Name"
objSelection.TypeText Chr(11)
objSelection.TypeText "Company Tagline"
objSelection.TypeText Chr(11)
objSelection.TypeText Chr(11)
objSelection.TypeText "Company Website"



Set objSelection = objDoc.Range()

objSignatureEntries.Add "Standard Signature", objSelection
objSignatureObject.NewMessageSignature = "Standard Signature"

objDoc.Saved = True
objWord.Quit

Set oShell = CreateObject("Wscript.Shell") 

sRegFile = "\\file1\users\Clerical\wallpaper\siglock.reg"
oShell.Run "regedit.exe /s " & Chr(34) & sRegFile & Chr(34), 0, True

问题解决了…显然这3台机器上有一些Word 2000的残余…我清理了它,解决了我的问题

即使是你自己写的答案,检查它是否正确,人们就会知道问题已经解决了。你不会因为有正确的答案而获得通常的声誉。