Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows Script Host
Message
 
To
31/08/2000 16:08:31
Steve Summers
Pima County Superior Court
Tucson, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00411480
Message ID:
00411483
Views:
11
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform