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

  1. proc writeBatch {appname} {
  2.  
  3. variable tmpdir
  4. variable currentinstall
  5.  
  6. set tmpdir /Users/kevin/Desktop
  7. set currentinstall /Users/kevin/Desktop
  8.  
  9. set batchscript "
  10. :Repeat
  11. del [file join $currentinstall $appname.exe]
  12. if exist [file join $currentinstall $appname.exe] goto Repeat
  13. copy [file join $tmpdir $appname.exe] [file join $currentinstall $appname.exe]
  14. start [file join $currentinstall $appname.exe]
  15. del [file join $tmpdir deleteapp.bat]
  16. "
  17. set delscript [open [file join $tmpdir deleteapp.bat] w]
  18. puts $delscript $batchscript
  19. close $batchscript
  20.  
  21.  
  22. }
  23.  
  24. writeBatch Foo