How to Run a Process on a Remote PC With Wmi VB.NET

Written by jim campbell
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Run a Process on a Remote PC With Wmi VB.NET
(Jupiterimages/ Images)

The Windows Management Instrumentation (WMI) service runs on all Windows computers. You can use this service to invoke software and instructions on the computer. You can also use the WMI service to invoke a service on a remote computer. You must log in to the remote computer from the VB.NET application code. This is beneficial for programmers creating network administration applications.

Skill level:

Other People Are Reading


  1. 1

    Click the Windows "Start" button and select "All Programs." Click "Microsoft .NET Framework," then click "Visual Studio" to open your programming software.

  2. 2

    Click the "File" menu item when Visual Studio loads. Click "Open." Double-click your project file to open your VB.NET project.

  3. 3

    Right-click the form in the panel labelled "Solution Explorer." Select "View Code" to open the code file where you type your code to invoke the service on the remote computer.

  4. 4

    Type the following code into your project file:

    Dim connection As New System.Management.ConnectionOptions

    computer = New System.Management.ManagementScope("\computername\root\cimv2", connection)

    service = New System.Management.ManagementObjectSearcher(connection.Path.ToString, "Select servicename From Win32_Product")


    Replace "computername" with the name of the remote computer to which you want to connect. Replace "servicename" with the name of the service you want to run.

  5. 5

    Click the "Save" button at the top of your Visual Studio window. To test your new code, click the "Run" button in the toolbar to execute the code.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.