VB.NET: 使用 WMI 呼叫應用程式
Using mr As New ManagementClass("Win32_ProcessStartup")
Dim objConfig As PropertyData = mr.Properties("ShowWindow")
objConfig.Value = 1
Using mc As New ManagementClass("Win32_Process")
mc.Scope.Options.EnablePrivileges = True
Dim inParams As ManagementBaseObject = mc.GetMethodParameters("Create")
inParams("CommandLine") = "Notepad.exe"
inParams("CurrentDirectory") = Environment.SystemDirectory
inParams("ProcessStartupInformation") = mr
Dim outParams As ManagementBaseObject = mc.InvokeMethod("Create", inParams, Nothing)
Dim returnObj As Object = outParams("ReturnValue")
End Using
End Using
已經成功使用 WMI 呼叫應用程式, 但如何呼叫遠端呢? 努力中...
留言