• Welcome to Jose's Read Only Forum 2023.
 

IWshURLShortcut.TargetPath Property

Started by José Roca, July 14, 2008, 06:18:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following code illustrates the use of the TargetPath property:


#INCLUDE "WSHOM.INC"

' Create an instance of the Windows Script Host
LOCAL pWsh AS IWshShell
pWsh = NEWCOM "WScript.Shell"

' Create a shortcut programatically (if it already exists, CreateShortcut opens it)
LOCAL pLnk AS IWshURLShortcut
pLnk = pWsh.CreateShortcut(UCODE$(EXE.Path$ & "Microsoft Web Site.url"))

' Sets the TargetPath property
pLnk.TargetPath UCODE$("http://www.microsoft.com")
' Saves the shortcut file to disk
pLnk.Save