I'm using Windows 8.1 and I'm running a tcl script that checks the difference between files:
package require twapi
proc diff {file1 file2} {
set f1 [open $file1 "rb"]
set f2 [open $file2 "rb"]
try {
while 1 {
if {[read $f1 4096] ne [read $f2 4096]} {
return 0
} elseif {[eof $f1]} {
# The same if we got to EOF at the same time
return [eof $f2]
} elseif {[eof $f2]} {
return 0
}
}
} finally {
close $f1
close $f2
}
}
I need to run this procedure in the background, but everytime I run it, it opens a windows terminal. I tried using a vbs script and it works:
CreateObject("Wscript.Shell").Run "diff.tcl",0,True
But I need to pass the arguments to the diff.tcl from another program so running as a vbs script is not useful.