>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