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

.bat file question: how to get DOS box to close

Status
Not open for further replies.

MandoThrasher

Programmer
Jul 12, 2002
49
0
0
US
Is there any way to write a batch(.bat) file that doesn't leave the DOS window open after execution in Windows95-98? I know I could use a .pif file in 98, but am concerned about doing that because this is going on a CDROM for use on various Windows OS's. I don't think 2000 will even let you create a .pif file. The problem only occurs on 95/98.

Not sure if this is the right forum for this, but was the closest thing I could find.
 
You might try placing an "EXIT" statement as the last line of the bat file Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
tried that, but it still leaves the window open on 98 machines.
 
Hunh, you are right.

On 9x on the desktop Icon i guess you have to click on

Properties > program > Close on Exit







-------------------------------------
Jnick opinions are not necessarily those of
Code:
Ronin Software Group
 
Duh, I knew this....

Prefix the DOS command with, e.g. to do DoIt

command /c doit.....

which ought to spawn a temporary DOS VM.

You might have to provide path information for "Command", look for Command.com.

NT/2000 might not be the same.



-------------------------------------
Jnick opinions are not necessarily those of
Code:
Ronin Software Group
 
If you want to make the Batch File close on the end of its processing, you use the command "cls" at the very end. That will make it close after it is done. Make sure there are no commands after the cls function.
 
I'm using a batch file to compare the version of a database on the server to the version on the local PC and copy it over if necessary. The batch file then launches the database application of the local PC but the DOS window forces my application to use only the lower half of my screen. This still happens even though I have the DOS prompt running minimized. Does anybody have a fix?

I've tried putting cls as the last line. I've tried exit as the last line. I've tried various connotations of doit. But the window will not close until I close my database application. Okay, I can live with that but why is it scrunching up my database window? Ann
 
Well, if you don't need to look at the BAT file doing it's thing, it can be run so that it does not open a visible DOS window at all.

I know when I shell a BAT file from a VB program, that if I use the vbHide paremeter it will not display the DOS window as the BAT file runs.

I think your solution is in how the BAT file is lanched, and if there is a command line parameter that can be added to make it execute invisibly. Unfortunatly, I can't remember what the DOS command would be for that....

Robert
 
I really don't want to run the batch file from within my application 'cause I don't want to open the app until the newer version is copied if needed.

I just can't seem to figure this one out. Guess what I'll do is let my users open the front end using my target and send them a desktop icon to run the batch file after I post a new design on the server. Oh, well...

Thanks for your input. Ann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top