0
我正在使用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