Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Create Shortcuts/Get Desktop Folder
Message
De
14/01/2004 12:44:02
 
 
À
14/01/2004 11:21:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00866766
Message ID:
00866824
Vues:
18
>Does any one know how to create a windows shortcut programatically?
>
>And along with that determine the Desktop folder to save it into?
>
>Thanks.
>
Hi Bob;

Helped by George (and Franco) I found this one, that can do what you want:

(With WSH only)
oShell           = CREATEOBJECT("WScript.Shell")
oFso             = CreateObject("Scripting.FileSystemObject")
cwdesktopfolder  = oShell.SpecialFolders("Desktop")

lnk              = oShell.CreateShortcut(cwdesktopfolder + "\Shortcut to my application.lnk")
lnk.TargetPath   = "c:\myfolder\myapp.exe"
lnk.WindowStyle  = 1
lnk.Hotkey       = "CTRL+SHIFT+F"
lnk.IconLocation = "c:\myfolder\myapp.exe, 0"
lnk.Description  = "Shortcut to my application"
lnk.WorkingDirectory = "c:\myfolder"
lnk.Save
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform