Posted to tcl by kevin_walzer at Wed Oct 07 02:25:06 GMT 2015view pretty

proc writeBatch {appname} {

variable tmpdir
variable currentinstall

set tmpdir /Users/kevin/Desktop
set currentinstall /Users/kevin/Desktop

set batchscript "
:Repeat
del [file join $currentinstall $appname.exe]
if exist [file join $currentinstall $appname.exe] goto Repeat
copy [file join $tmpdir $appname.exe] [file join $currentinstall $appname.exe]
start [file join $currentinstall $appname.exe]
del [file join $tmpdir deleteapp.bat]
"
set delscript [open [file join $tmpdir deleteapp.bat] w]
puts $delscript $batchscript
close $batchscript


}

writeBatch Foo