Jitesh Byahut 2/16/2014 2322

Win32_StartupCommand in WMI C# Asp.Net

Here we are retrieving Start up Commands details of Computer.

Use namespace System.Management

using System.Management;

 

public partial class Win_Win32_StartupCommand : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

ManagementObjectSearcher objcomnd = new ManagementObjectSearcher("select * from Win32_StartupCommand");

 

        foreach (ManagementObject obj in objcomnd.Get())

        {

            Response.Write("Name  -  " + obj["Name"] + "</br>");

            Response.Write("User  -  " + obj["User"] + "</br>");

            Response.Write("Command  -  " + obj["Command"] + "</br>");

            Response.Write("Location  -  " + obj["Location"] + "</br></br>");

        }

    }

}

Demo

View output :

demoimage


Please give your feedback for improving this page