Re: How to close DOS window?



Instead of executing the batch file directly, try executing through
cmd with the /c switch. Something like
set backup {cmd /c c:\robocopy\backup.bat}

Note the \, not / since you are passing the path as an argument to
cmd.

/Ashok

On Jul 31, 7:25 pm, electr0n wizard <ub...@xxxxxxxxxxxxx> wrote:
I wrote a simple tk script that I can use to invoke a backup (from a
DOS batch file). It works great but when the backup is complete I'd
like to close out the DOS window. I'm pretty new to tcl/tk so I don't
know if it's a switch option (like /MIN to minimize the DOS window) or
if I have to use | to look for some feedback and then send some
command to close the window that way.

Sorry for the noob question, but I did a search and didn't find
anything appropriate (that I could understand).
Here's the script:

wm title . "Backup"
frame .top -borderwidth 20
set backup {"C:/Robocopy/backup.bat" &}
button .top.but1 -text "Backup" -command {eval exec [auto_exe***
start] $backup; destroy .} -width 10
button .top.but2 -text "Quit" -command {destroy .} -width 10
pack .top .top.but1 .top.but2 -side top

Again all I need is to call an MS-DOS batch file (I'm running WinXP)
then close the DOS window when it's done with the backup. Right now
everything works but the DOS CMD window stays open and I manually have
to close it. Thanks in advance.



.


Quantcast