Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run an unrelated .lnk from w/in vfp ?

Status
Not open for further replies.

mallee

Programmer
Nov 7, 2000
116
I created a winzip (wzzip) icon on desktop that holds the
command line syntax to backup my data. How can I run this icon from within VFP 6.0 ?

Thanks in advance.
 
ShellExecute() lets you programmatically launch any application which is installed on the computer.

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin


Because ShellExecute() is an API function, you need to declare it before you can call it. The DECLARE statement establishes the number and data types of the parameters, and also the data type of the returned value. You only need to execute the DECLARE statement once, but you must do so before the first time you call ShellExecute().

lets assume your short cut has this in the Target of the short cut. "f:\Data\Archive.Zip"

cFileName = "f:\Data\Archive.Zip"
cAction = "open"
ShellExecute(0,cAction,cFileName,"","",1)

Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top