[英]Powershell how to run a program and waiting in a remote session
I have a command line program that listen to a tcp port until user type Q to exist. 我有一个命令行程序,它监听tcp端口,直到用户类型Q存在为止。 It works fine in local powershell window.
它在本地Powershell窗口中运行良好。 But when I try to run it on another machine using powershell remote session, it just starts and quit.
但是,当我尝试使用Powershell远程会话在另一台计算机上运行它时,它将启动并退出。 Is there a way to keep it running?
有没有办法让它继续运行?
The remote script runs in a PowerShell that never becomes visible so AFAICT it doesn't even got a console handle by which to handle reading keyboard input. 远程脚本在永远不会显示的PowerShell中运行,因此AFAICT甚至没有控制台句柄来处理读取键盘输入。
You can take a look at the SysInternals utility - psexec
. 您可以查看SysInternals实用程序
psexec
。 From my testing, that utility works for what you are trying to do. 根据我的测试,该实用程序可以满足您的需求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.