?
Solved

Closing MSDOS windows in Delphi

Posted on 2000-04-08
3
Medium Priority
?
309 Views
Last Modified: 2010-04-04
Hello,
I have written a DOS batch file that runs from my delphi program using the
shell execute statement.Note the application runs hidden since I used the
SW_HIDE command.
Problem: how do I close the MSDOS box or
application when I exit my delphi application. In my batch file I use the
'exit' command which terminates the batch file okay but not the msdos box
where the batch ran from.I found this
out when I shut down windows that the
MSDOS windowed box was still open but
note the batch file had terminated.
Regards,
Frank
0
Comment
Question by:frw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 2697095
Hi,
you can use:

WinExec('command.com /c Some.bat',SW_HIDDEN);
 
calling command.com with the /c closes the dos window when finshed.
 
you can also use command.com /c with shellexecute but it saves adding the whole shellapi unit to your uses by just using winexec() ..

Regards Barry
0
 
LVL 17

Accepted Solution

by:
inthe earned 400 total points
ID: 2697135
yep ive just tested and works fine..
0
 

Expert Comment

by:MWilson
ID: 2697170
The easiest, non-code way to get the DOS window to close is to use the Windows Explorer to locate the batch file name, right click it to show the Properties, and then check the "Close on Exit" option.

This will work for Windows 95, 98, NT 4.0, and 2000.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

777 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