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

Problem with ShellExecute on a batch file that must receive parameters

Status
Not open for further replies.

baseballgem

Programmer
Oct 3, 2001
54
US
I was reading about shellexecute() and was wondering how to execute a batch file when the batch file is structured to receive parameters.

I can do it using the run command. But I would like to employ shellexecute and have the ugly dos window not appear.

Have not been able to figure out how to do it. As a run command I say

run "Catch.bat" "User" &gUser "Has "Attempted" x "Times"

Any suggestions as to the correct synatax for shell execute when a batch file receives parameters.
 
Hide DOS Window When Runnig DOS Commands
faq184-4259

How to run DOS program in background effectively
faq184-4377

Slighthaze = NULL
craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
baseballgem,

You should be able to pass the parameters in the fourth parameter to ShellExecute(). For example:

ShellExecute(0,"open","c:\dos\mybatch.bat","param1, param2, param3","",1)

You might also like to check out my article on ShellExecute(), at:

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top