• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

IWshShortcut.FullName Property

Started by José Roca, July 14, 2008, 06:54:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following code illustrates the use of the FullName property:


#INCLUDE "WSHOM.INC"

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

' Creates a shortcut programatically (if it already exists, CreateShortcut opens it)
LOCAL pLnk AS IWshShortcut
pLnk = pWsh.CreateShortcut(UCODE$(EXE.PATH$ & "Test.lnk"))

' Sets variuos properties and saves them to disk
pLnk.Description = UCODE$("Hello world")
pLnk.WorkingDirectory = UCODE$(EXE.PATH$)
pLnk.Arguments = UCODE$("/c")
pLnk.HotKey = UCODE$("Ctrl+Alt+e")
pLnk.IconLocation = UCODE$(EXE.PATH$ & "PROGRAM.ICO,0")
pLnk.RelativePath = UCODE$(EXE.PATH$)
pLnk.TargetPath = UCODE$(EXE.PATH$ & "EX_WHLNK_CreateShortcut.EXE")
pLnk.WindowStyle = %WshNormalFocus
pLnk.Save

' Get the parameters to to see if they have changed
STDOUT "Full name: " & ACODE$(pLnk.FullName)