我正在向 GPO 添加登录脚本来为我安装程序。有人能看出这个脚本有问题吗?当 PC 启动时,它会提示可以找到资源?
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\...
看起来上面只使用了一个反斜杠。