Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spawning a MS DOS PROMPT 1

Status
Not open for further replies.

komyg

Programmer
Dec 13, 2005
68
BR
Ok, I just need to spawn console based program and input commands to it.
So I started with something simple, opening a ms dos prompt and sending commands to it, but as I try to do this using:
"spawn -console cmd.exe", the process is created but the prompt window doesn't pops up.
What am I doing wrong?

Please Help,
Komyg
 
Well I finally got it!
The final code is:

set id [open "|wmconsole.exe RC1" r+]
puts $id {exec ODA 4659 1}
puts $id "\r\n"
flush $id

Thank you so much for your help,
Komyg
 
So now you're not using any Expect commands, huh???

Sorry I didn't exactly "catch" all you were trying to do - I was too focus on Expect ...

Also, after your flush cmd, you should "close" the fid.
e.g. - close $id

Also, check-out tcl's "fconfigure" cmd, which enable you to fine-tune your I/O channel options (e.g. - buffering, eofchar, blocking, etc.).
e.g. - fconfigure $id -buffering line

...Good luck!!


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top