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

Write to a batch file that closes on exit 1

Status
Not open for further replies.

sggaunt

Programmer
Jul 4, 2001
8,620
GB
Does anyone know how to create a batchfile,eg memo.lines.savetofile('afile.bat');

and have it close on exit. As it would if the box was checked on the PIF dialog.
In otherwords word how do you 'check' the 'close on exit' box from a delphi programme?.
I can't seem to find anything on this in the API Help.

Steve
 
Just add CLS as the last command in the file. ;-)

HTH, TonHu
 
TonHu

I wrote simply.

CLS

In notepad and saved it as Test.bat.
Execute this and it's fine the window closes.

However if i do the same thing.

e.g.

stringlist.savetofile('test.bat');
or
Use a file variable to do the same thing in a Delphi program, then it dosent close the window.

If I open this file in notepad delete the text(CLS) then put it back and resave the file.
Still no good.

If I cut and paste from the Delphi produced file (opened in notepad) to a new notepad file it's OK!!!

Whats going on, I have checked the Progam info dialogs on both versions they are identical.

Help

Steve.
 
Truly weird

I did this two days ago and it works. I use a constant file named ticket.bat and set that file's properties to close on exit, not the pif's. And guess what - mine works!
Delete the pif, the the bat file's and run it again from the app. Might work.
 
Diggiehbr
I sloved (got round) this when I found that if you save from a memo with CLS as the last line it works.

But do you know how to set the close on exit flag from a Delphi Programme ?

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top