首页 > 解决方案 > 如何使用 vb.net 和 cmd 检查程序是否在不同的服务器上运行

问题描述

我需要检查是否有任何程序在我有权访问的不同服务器上运行。

例如: 服务器名称:remoteServer.xyz.com 应用程序:Notepad.exe

从我的机器作为管理员我可以访问remoteServer.xyz.com 所以我如何检查是否Notepad.exe正在remoteServer.xyz.com 使用vb.netcmd

我使用了以下代码

Dim p As Process = New Process()
Dim pi As ProcessStartInfo = New ProcessStartInfo()
pi.Arguments = "tasklist /s remoteServer.xyz.com"
pi.FileName = "cmd.exe"
p.StartInfo = pi
p.Start()

但这只是打开一个命令提示符,不传递参数并执行

标签: vb.netbatch-filecmd

解决方案


推荐阅读