Stsrt .exe域计算机 WMI 进程上的安装程序



我正在处理一个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:PathInstall.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

我有一个更新程序,在下载必要的文件后,它需要启动exe文件。它使用以下代码:

    Dim MyPath As String
    MyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase)
    Dim SoftwarePath As String = MyPath & "Program.exe"
    If File.Exists(SoftwarePath) Then
        Process.Start(SoftwarePath, "")
        Application.Exit()
    End If

最新更新