Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Closing MSDOS windows in Delphi

Posted on 2000-04-08
3
Medium Priority
?
311 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

618 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