我正在使用 VBscript 修改快捷方式的目标路径,但我无法这样做。当我运行脚本时,我没有收到任何错误,但似乎脚本没有做任何事情,即目标路径没有改变。这是我的脚本
Private Sub Change_ShortCut(TargetPath, ShortCutPath, ShortCutname, WorkPath, ServerName, PortNumber, ServiceName, ExecVar)
Dim VbsObj
Dim userName
Dim hostName
' Get user name and host name from another method
Get_UserName userName, hostName
Const ALL_USERS_DESKTOP = &H19&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(ALL_USERS_DESKTOP)
Set objFolderItem = objFolder.ParseName("App1.lnk")
Set objShellLink = objFolderItem.GetLink
Wscript.Echo objShellLink.Path
objShellLink.Path = TargetPath & ServerName & " " & PortNumber & " " & ServiceName & " " & userName & " " & hostName & " 20 -exec=" & """" & "\""" & ExecVar & "\""" &""""
objShellLink.Save
End Sub