Save Method

 

Description

 

Saves a shortcut object to disk.

 

PowerBASIC Syntax

 

METHOD Save ()

 

Remarks

 

After using the CreateShortcut method to create a shortcut object and set the shortcut object's properties, the Save method must be used to save the shortcut object to disk. The Save method uses the information in the shortcut object's FullName property to determine where to save the shortcut object on a disk. You can only create shortcuts to system objects. This includes files, directories, and drives (but does not include printer links or scheduled tasks).

 

Example [PowerBASIC]

 

#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

 

Valid XHTML 1.0 Transitional