2014-01-24 43 views

回答

0

此批处理脚本运行powershell Stop-Service cmdlet和uses the -force参数。无论打开连接如何,它都会停止服务,并在终端服务上使用开放式RDP会话进行测试。

@ECHO OFF 
start /b /wait powershell.exe -command "Stop-Service -name TermService -force;$STATUS = (Get-Service termservice).status;Write-Host `"Termservice is $STATUS`"" 
PAUSE 
+0

似乎与'-name服务器',这是我想要的。需要知道我的XP机器是否安装了PowerShell。谢谢!不知道如何将此标记为答案,系统不会让我向上箭头。 – HASM

+0

在向上的箭头下面有一个东西看起来像雪佛龙,如果你点击它就会变成绿色。那就是如何接受答案。祝你好运 –

相关问题