timer question (1 Viewer)

UniqueTII

What?
Local time
Today, 07:57
Joined
Apr 4, 2002
Messages
96
I have searched quite a bit and can't seem to find an answer for my problem.

I have a button that runs a .bat file and at the end of the .bat file, I need to press a key to close the DOS window. I was hoping I could create a timer for 1 or 2 seconds that will close the DOS window (using SendKeys?) and return focus to my form with the button on it. How could I set up a timer on the OnClick function of the button to do this?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:57
Joined
Feb 28, 2001
Messages
27,259
If it is a well-behaved DOS window, it should close if you end the batch file with EXIT as a command intended for the COMMAND prompt.

If it doesn't do what you expected, I think you need to consider the default settings for DOS windows, one of which is, I believe, "Close on EXIT."
 

UniqueTII

What?
Local time
Today, 07:57
Joined
Apr 4, 2002
Messages
96
Thanks for the effort Doc, but no luck. :(

Actually, it's not really a DOS window, because I am using Win2Kpro, so it's a command prompt. If I changed my local settings, that wouldn't really do what I want it to do, since there is more then one user with access to the database.
The .bat file looks like this:
Code:
@echo off
echo deleting
pause
H:
cd\
cd\sfina\groups\FINAID\Stud_Emp\Database\DBtoWEB\jobs\nws
del *.html
cd\sfina\groups\FINAID\Stud_Emp\Database\DBtoWEB\jobs\ws
del *.html
cd\sfina\groups\FINAID\Stud_Emp\Database\DBtoWEB
del dbtoweb.ini
echo done
and I tried adding an "exit" both before and after the "echo done" line with no luck. Any other ideas?

EDIT: I don't know why it keeps wrapping, but you get the idea (the lines starting with "obs" should be on the line above them.
 
Last edited:

Users who are viewing this thread

Top Bottom