
我將登入腳本新增至 GPO 來為我安裝程式。誰能看出這個腳本有問題嗎?當電腦啟動時,它會出現說可以找到資源?
Const EVENT_SUCCESS = 0
On Error Resume Next
strPlugin = "HKLM\Software\BottomlineTechnologies\TransformInstallationSystem\CurrentInstallPath"
strApp = "cmd /c \\int.company.com\sysvol\int.company.com\scripts\Apps\setup.exe installpath selectall autoexit hide"
Set WSHShell = CreateObject("WScript.Shell")
sReg = WSHShell.RegRead(strPlugin)
If Err.Number <> 0 Then
Err.Clear
'Plugin not yet installed
WSHShell.Run strApp, 0, true
WSHShell.LogEvent EVENT_SUCCESS, "InstalledPlugin"
Else
WSHShell.LogEvent EVENT_SUCCESS, "Plugin already installed."
End If
WScript.Quit
答案1
乍看:UNC路徑需要以兩個反斜線開頭,分別是:
strApp = "cmd /c \\int.company.com\sysvol\...
上面似乎只用了一個反斜線。