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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ShellExecute / Run Problem 4

Status
Not open for further replies.

keepingbusy

Programmer
Apr 9, 2000
1,470
GB
Hi all

Having sifted through some ShellExecute commands, can someone suggest why this isn't working. I am trying to run an EXE file via VFP6 called wuw.exe which is not a VFP app but starts another process (Web Update Wizard) which in turn down loads updated files / tables. When I use:
Code:
!wuw.exe
[URL unfurl="true"]http://www.mysite.co.uk/subfolder/data/abcdef.txt[/URL]
thats fine, but you get the old black dos screen. Any suggestions would be greatly appreciated.
Code:
DECLARE INTEGER ShellExecute IN shell32.dll ; 
  INTEGER hndWin, ; 
  STRING cAction, ; 
  STRING cFileName, ; 
  STRING cParams, ;  
  STRING cDir, ; 
  INTEGER nShowWin
cFileName ="c:\testftp\wuw.exe
[URL unfurl="true"]http://www.mysite.co.uk/subfolder/data/abcdef.txt"[/URL]
cAction = "open"
ShellExecute(0,cAction,cFileName,"","",1)

CLEAR DLLS ShellExecute

Many thanks
Lee

VisFox Version 6 & 9 User / Windows XP
 
Try your code, with these line changes:
Code:
cFileName ="c:\testftp\wuw.exe"
cParams = "[URL unfurl="true"]http://www.mysite.co.uk/subfolder/data/abcdef.txt"[/URL]
cDir="c:\testftp"
ShellExecute(0,cAction,cFileName,cParams,cDir,1)

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Hi Bill

Had an error message "Variable CACTION is not found"
So I tried adding:
Code:
cAction = "open"
Now there is an error "File shellexecute.prg does not exist"

Lee

VisFox Version 6 & 9 User / Windows XP
 
Maybe "with these line changes" means:
"other lines remain same, don't remove them"..... :)
 
Lee,

Does the error...
"File shellexecute.prg does not exist"
...occur because you haven't declared ShellExecute?

Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks, Foxdbs: exactly....

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

cAction  ="open"
cFileName="c:\testftp\wuw.exe"
cParams ="[URL unfurl="true"]http://www.mysite.co.uk/subfolder/data/abcdef.txt"[/URL]
cDir     ="c:\testftp"
ShellExecute(0,cAction,cFileName,cParams,cDir,1)

CLEAR DLLS ShellExecute

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
foxdbs, stewartuk and wgcs

Thank you for your posts and sorry for the delay in posting back. I'll try out the last suggestion and let you know soon

Regards
Lee

VisFox Version 6 & 9 User / Windows XP
 
Hi all

Had a chance to test the above code posted by wgcs and it works perfectly.

Many thanks to all who posted on this thread for which I'm grateful.

I know we don't do advertising on Tek-Tips, but I'm posting this information to assist others who may be looking for a program that automatically downloads and installs updated files by executing the APP via VFP. The software is called Web Update Wizard and can be found at
Thanks again all

Lee

VisFox Version 6 & 9 User / Windows XP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top