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!

vfp and wscript.shell- sending parameter syntax. 1

Status
Not open for further replies.

CMcC

Programmer
Feb 5, 2002
196
US
Good day all-
Want to run a DOS 2.6 .exe in VFP 7.
I would like to take advantage of the shell object so I can hide the DOS window that is visible during the dos runtime.
Having trouble sending parameters...not sure of the syntax.
Error I keep getting:

"Function name is missing )."

Here is what I have..
loShell = CREATEOBJECT("wscript.shell")
lnSuccess = loShell.Run(bkbill.exe &mtype &bkparcel &bkyear,2,.t.)

Any suggestions?
thanks
cmcc
 
cmcc,
Since the first parameter of the Run() method is a string, I'd start my trying:
Code:
loShell = CREATEOBJECT("wscript.shell")
lnSuccess = loShell.Run("bkbill.exe &mtype &bkparcel &bkyear",2,.t.)
Or you may need to try:
Code:
loShell = CREATEOBJECT("wscript.shell")
lcCmd = "bkbill.exe "+mtype+" "+bkparcel+" "+bkyear
lnSuccess = loShell.Run(lcCmd,2,.t.)
Rick

 
thank you rgbean.
2nd option worked great.
cmcc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top