Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click Try Dim strComputer = TxtPCname.Text Dim strcommand As String Dim intProcessID As UInt32 strcommand = "cmd.exe /c netsh advfirewall firewall set rule group=""windows management instrumentation (wmi)"" new enable=yes" Dim objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Dim objStartup = objWMIService.Get("Win32_ProcessStartup") Dim intreturn As Integer Dim objConfig = objStartup.SpawnInstance_ objConfig.ShowWindow = 12 Dim objProcess = objWMIService.Get("Win32_Process") intreturn = objProcess.Create(strcommand, NULL, objConfig, intProcessID) MsgBox(intreturn) Catch ex As Exception MsgBox(ex.Message) End Try End Sub
netsh
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)