How to set process name/description?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mdb

    How to set process name/description?

    When I view my running processes with SysInternals Process Explorer, most of
    the processes have actual names (called "Descriptio n" in Process Explorer)
    and Company Names set for the process. Mine (a .NET windows service) does
    not. Anyone know how I can set this value?

    --
    -mdb
  • steve

    #2
    Re: How to set process name/description?

    Have you created an installer class in the service? Something like
    this:

    /// <summary>
    /// Summary description for ServiceRegister .
    /// </summary>
    [RunInstaller(tr ue)]
    public class ServiceRegister : System.Configur ation.Install.I nstaller
    {
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.Componen tModel.Containe r components = null;
    private ServiceInstalle r serviceInstalle r;
    private ServiceProcessI nstaller processInstalle r;

    public ServiceRegister ()
    {
    // This call is required by the Designer.
    InitializeCompo nent();

    // define and create the service installer
    serviceInstalle r = new ServiceInstalle r();
    serviceInstalle r.StartType = ServiceStartMod e.Manual;
    serviceInstalle r.ServiceName = ServiceControl. ServiceControlN ame;
    serviceInstalle r.DisplayName = ServiceControl. ServiceControlD esc;
    Installers.Add( serviceInstalle r);

    // define and create the process installer
    processInstalle r = new ServiceProcessI nstaller();
    #if RUNUNDERSYSTEM
    processInstalle r.Account = ServiceAccount. LocalSystem;
    #else
    //use the local system account
    processInstalle r.Account = ServiceAccount. LocalSystem;

    // should prompt for user on install
    //processInstalle r.Account = ServiceAccount. User;
    //processInstalle r.Username = null;
    //processInstalle r.Password = null;
    #endif
    Installers.Add( processInstalle r);
    }

    #region Component Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeCompo nent()
    {
    components = new System.Componen tModel.Containe r();
    }
    #endregion
    }

    Comment

    • mdb

      #3
      Re: How to set process name/description?

      "steve" <steve_c_t@hotm ail.com> wrote in
      news:1125336111 .319067.183630@ o13g2000cwo.goo glegroups.com:
      [color=blue]
      > Have you created an installer class in the service? Something like
      > this:
      > serviceInstalle r.ServiceName =
      > ServiceControl. ServiceControlN ame;
      > serviceInstalle r.DisplayName =
      > ServiceControl. ServiceControlD esc;[/color]

      Yes. Those are used in the Services Control Panel and stored in the
      Registry, but apparently are not used for the names of processes that are
      actually running. I'm referring to the 'Description' and 'Company Name'
      fields found in SysInternals Process Explorer (these bits of information are
      apparently NOT available in standard Task Manager.) You can get Process
      Explorer at http://www.sysinternals.com/Utilitie...sExplorer.html

      --
      -mdb

      Comment

      • mdb

        #4
        Re: How to set process name/description?

        mdb <m_b_r_a_y@c_t_ i_u_s_a__d0t__c om> wrote in
        news:Xns96C185D C1F647mbrayctiu sacom@207.46.24 8.16:
        [color=blue]
        > When I view my running processes with SysInternals Process Explorer,
        > most of the processes have actual names (called "Descriptio n" in Process
        > Explorer) and Company Names set for the process. Mine (a .NET windows
        > service) does not. Anyone know how I can set this value?
        >[/color]

        Hmmm after a bit of checking, I think that these two properties are built
        into the .EXE file itself. (Right-click EXE, Properties...) Then under the
        Version tab, there are several properties listed. Both 'Product Name' and
        'Company' are blank. I would like to provide values for these, but I have no
        idea if VS.NET build can do that... Anyone?

        --
        -mdb

        Comment

        • mdb

          #5
          Re: How to set process name/description?

          mdb <m_b_r_a_y@c_t_ i_u_s_a__d0t__c om> wrote in
          news:Xns96C18B3 9434B4mbrayctiu sacom@207.46.24 8.16:
          [color=blue]
          > Hmmm after a bit of checking, I think that these two properties are
          > built into the .EXE file itself. (Right-click EXE, Properties...) Then
          > under the Version tab, there are several properties listed. Both
          > 'Product Name' and 'Company' are blank. I would like to provide values
          > for these, but I have no idea if VS.NET build can do that... Anyone?
          >[/color]

          OK I feel stupid. Its in the AssemblyInfo. 8-|

          --
          -mdb

          Comment

          Working...