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

hiding batch file execution 1

Status
Not open for further replies.

kraus

MIS
Oct 16, 2000
23
US
i'm running a batch file from one of my forms. how do i stop the dos window from appearing when the batch file runs?

after the batch file runs the graphics on my form shifts down about a half inche - hiding the bottom of my form.
 
Hi

loShell = CREATEOBJECT("wscript.shell")
lnSuccess = loShell.Run("myBatchFile",0,.t.)

:)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Hi
I pressed the submit button too early..

Another way to do it is..

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, STRING cAction, STRING cFileName, ;
STRING cParams, STRING cDir, INTEGER nShowWin
=ShellExecute(0,"open","myFile.bat","","",0)

:)


ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Ramani,
That's interesting.
Can I hide this way Dos window from RUNning a single Dos command (VFP6)? It doesn't bother me much, so I never thought of hiding it before, but it would be nice, though.
Stella
 
thanks ramani,

i don't quite understand it, but it works

very impressive, i will study it

matthew kraus
 
ramani - sorry to bother you again but...

i don't understand what the parameters (declare integer)means..

can you please explain?
 
kraus,

There is a nice tutorial on the ShellExecute function on Mike Lewis's website:


Mike Lewis is also a member here.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.
[/li][/ul]
 
Kraus

I don't understand what the parameters (declare integer)means..

Here is the definition of API from Microsoft:
Windows API
The Windows API (Application Programming Interface) consists of the functions, messages, data structures, data types, and statements you can use in creating applications that run under Microsoft Windows. The parts of the API you use most are code elements for calling API functions from Windows. These include procedure declarations (for the Windows functions), user-defined type definitions (for data structures passed to those functions), and constant declarations (for values passed to and returned from those functions).


In Ramani's example ShellExecute is an API call to a Windows function. Each of the API calls require parameters. If you want to learn more about using API calls in VFP, look at this link:



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top