Solved

running a dos app without showing it

Posted on 2000-03-31
3
127 Views
Last Modified: 2010-04-04
Hello,

I need to run, from within a Delphi app, a DOS command-line proggy. It's easy, BUT... I do not want it to show. Well, if it encounters problems (like "file not found" or the like), ok, let it display the DOS prompt window, but otherwise it has to run without showing. Please, a working piece of code to achieve this...

yegor
0
Comment
Question by:yegor
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 45 total points
ID: 2675215
Hi Yegor, use

WinExec('someapp.exe');

or

ShellExecute(Handle, 'open', 'someapp.exe', '', '', SW_HIDE);

Cheers,

Epsylon.
0
 

Author Comment

by:yegor
ID: 2675235
Epsylon,

lot of thanks! ShellExecute refused to work (I dunno why, perhaps something missing in the uses clause...), but since you provided me with the magic word SW_HIDE, I have tried it in ExecuteFile, and it has worked!

Thank you,

yegor
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2675250
Sorry, put ShellAPI in the uses clause to be able to use ShellExecute.

Eps.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now