Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows Script Host
Message
 
À
31/08/2000 16:08:31
Steve Summers
Pima County Superior Court
Tucson, Arizona, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00411480
Message ID:
00411483
Vues:
10
>I recently read an Advisor tip on creating shortcuts that recomended using Windows Sripting Host object. The code was written in VB and I wanted to convert it to VFP code. I can't seem to create an instance of this class in VFP. Here is the VB code:
>
>Dim strDesktop As String
>Dim shl As IWshShell_Class
>Dim sct As IWshShortcut_Class
>
>Set shl = New IWshShell_Class
>strDesktop = shl.SpecialFolders("Desktop")
>
>Set sct = shl.CreateShortcut(strDesktop & _
> "\Notepad.lnk")
>sct.TargetPath = "Notepad.exe"
>sct.Description = "Start Notepad"
>sct.Save
>Set sct = Nothing
>Set shl = Nothing
>
>I found the library using the VB object browser and tried the following in VFP:
>
>o = createobject("IWshRuntimeLibrary.IWshShortcut_Class")
>
>VFP says it can't find this class?

Look at MS KB article Q244677 for a VFP example on how to do this. In order to create the object, you need:
oShell = CREATEOBJECT('WScript.Shell')
Ed and I cover will be covering this topic (and some others) in the Oct., 2000 VFUG newsletter.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform