Reputation: 1
I create a simple script in command prompt, test.cmd
.
When I run
c:\test.cmd myname
is your MyName [Y/n]
now I put Y
or n
and press enter to continue. How can i automate this in Tcl script?
I created test.tcl
exec test.cmd myname &
after 500
puts "Y\r"
but it is not working. Do you have any suggestions?
Upvotes: 0
Views: 97
Reputation: 246754
Try
set input "Y"
puts [exec test.cmd << $input]
Refer to the exec
documentation
Upvotes: 2