Author Topic: IWshURLShortcut.TargetPath Property  (Read 2791 times)

0 Members and 1 Guest are viewing this topic.

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2517
  • User-Rate: +209/-0
  • Gender: Male
IWshURLShortcut.TargetPath Property
« on: July 14, 2008, 06:18:16 AM »

The following code illustrates the use of the TargetPath property:

Code: [Select]
#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