Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running a Desktop Shortcut from VFP
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00551804
Message ID:
00552112
Views:
27
>>>>How can I Run a Desktop Shortcut from VFP?
>>>>
>>>>Thanks in advance,
>>>>
>>>Enmanuel,
>>>
>>>If you're asking how to create a desktop shortcut, or retrieve the names of the special folders such as the Desktop, Start Menu, etc., there are two resources you should consider.
>>>
>>>First is the Windows Script Host. The WScript.Shell object exposes a number of methods to deal with this. For more information, look at last October's issue of the VFUG newsletter, which is available on-line at www.vfug.org. This is the second in a series of articles written by Ed Rauh and myself dealing with the WSH.
>>>
>>>Second, if the WSH isn't an option, my LNKFILES.DLL available in the UT download section can do things like retrieving the desktop folder, creating shortcuts, etc.
>>
>>Thanks for your reply George. Actually I was looking for a simple way to run a shortcut as if I double-click it. Hilmar sent me the "START" command wich I didn't knew of and it worked. Anyway I'll take a look at the Windows Script Host, you never know when you may need it.
>>
>>Have a nice day,
>>
>>
>Enmanuel,
>
>Actually, the WSH could be of interest. First, it will retrieve the special folder names for you (so you don't have to hardcode them). Second, the WScript.Shell has a Run method that can be used to launch the shortcut (or any file with an association) directly.

Hello again George. You have made my day. I've found the WSH the perfect tool for my problem, basicly the "run and wait for program termination" part. I needed the program to stop until the called application terminate and the RUN method of the WSH allow me to do that.

Thanks again,

Enmanuel
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform