When you redirect stdin with cmd /k ... < commands.txt
, you're losing stdin. Why would you expect to get it back? All child processes inherit their base (0, 1, and 2) file descriptors.
Is commands.txt
a batch file? If so, why not run it instead of redirect commands from it?
You could copy that file to the remote machine, then invoke it, leaving cmd open.
runas /user:user1 "cmd /k remote /c computerB session_1 call c:\temp\commands.cmd"
When I do this, the cmd window is still left open and I can type into it.