【发布时间】:2017-11-02 09:17:12
【问题描述】:
我正在处理一个 Windows VB.net 表单,该表单正在检查域计算机中是否存在防病毒软件。如果缺少它,应用程序会将安装程序复制到域计算机本地 C:\ 驱动器。一切正常,但最后的难题是使用 WMI Win32_Process.Create 之类的东西将 .exe 安装程序作为后台进程调用。我的域计算机需要 .txt 文件中的软件,但我很难让这种方法发挥作用。我意识到 PowerShell 可能更适合于此,但这将用于 70 个不同的站点,这些站点的设置不一致。该应用程序允许轻松的用户交互(站点 IT 工程师),而不是他们调整脚本。任何有关实现此功能的最佳方法的建议将不胜感激。
到目前为止我所拥有的......
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles InstallButton.Click
Dim PCsource As String = "C:\Path\Install.txt"
Dim Check As String
Dim strCommand As String = "Antivirus.exe"
If System.IO.File.Exists(PCsource) = True Then
Dim Computer As New System.IO.StreamReader(PCsource)
Do While Computer.Peek() <> -1
Check = Computer.ReadLine()
Loop
End If
End Sub
【问题讨论】:
标签: vb.net network-programming wmi