Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Windows Service Urgent!!!

Windows Service Urgent!!!

Scheduled Pinned Locked Moved C#
helpquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Talktorajeev
    wrote on last edited by
    #1

    Hi folks, I am trying to change the display name of Windows Service using DisplayName property of Service Controller class. But the change is not reflected, don't know why? Is it a bug or am I doing something wrong. Reply soon. Thanks in advance Rajeev

    L 1 Reply Last reply
    0
    • T Talktorajeev

      Hi folks, I am trying to change the display name of Windows Service using DisplayName property of Service Controller class. But the change is not reflected, don't know why? Is it a bug or am I doing something wrong. Reply soon. Thanks in advance Rajeev

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      rajeevr@interrait.com wrote:

      I am trying to change the display name of Windows Service using DisplayName property of Service Controller class. But the change is not reflected, don't know why? Is it a bug or am I doing something wrong.

      From what I can see it is not possible to do what you want from the ServiceController class. xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!

      T 1 Reply Last reply
      0
      • L leppie

        rajeevr@interrait.com wrote:

        I am trying to change the display name of Windows Service using DisplayName property of Service Controller class. But the change is not reflected, don't know why? Is it a bug or am I doing something wrong.

        From what I can see it is not possible to do what you want from the ServiceController class. xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!

        T Offline
        T Offline
        Talktorajeev
        wrote on last edited by
        #3

        Hi leppie, Thanks for your prompt reply. Why its not possible to change display name using ServiceController class and do you know any other approach to do this. Regards Rajeev

        L 1 Reply Last reply
        0
        • T Talktorajeev

          Hi leppie, Thanks for your prompt reply. Why its not possible to change display name using ServiceController class and do you know any other approach to do this. Regards Rajeev

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          rajeevr@interrait.com wrote:

          Why its not possible to change display name using ServiceController class

          I dont know why.

          rajeevr@interrait.com wrote:

          do you know any other approach to do this.

          Perhaps the registry, but you will need admin rights to do so. xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!

          T 1 Reply Last reply
          0
          • L leppie

            rajeevr@interrait.com wrote:

            Why its not possible to change display name using ServiceController class

            I dont know why.

            rajeevr@interrait.com wrote:

            do you know any other approach to do this.

            Perhaps the registry, but you will need admin rights to do so. xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!

            T Offline
            T Offline
            Talktorajeev
            wrote on last edited by
            #5

            Hi tried with registry. It changes the display name in Property Window of Service only but not in cosole menu. And also in the object of Service Controller when reading property of the service after making change, DisplayName change doesn't reflect. But I were successgul in changing description. I am adding my code here private void button2_Click(object sender, System.EventArgs e) { ServiceController obj = new ServiceController("Telephony"); Microsoft.Win32.RegistryKey objReg; string str = obj.DisplayName; try { ServiceControllerEx objSercEx =new ServiceControllerEx("Telephony"); string strDes = objSercEx.Description; objReg = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Services\tapisrv",true); objReg.SetValue("DisplayName","Telephony5678"); objReg.SetValue("Description", "DEscription"); objReg.Close(); } catch(Exception ex) { MessageBox.Show(ex.Message); } }

            L 1 Reply Last reply
            0
            • T Talktorajeev

              Hi tried with registry. It changes the display name in Property Window of Service only but not in cosole menu. And also in the object of Service Controller when reading property of the service after making change, DisplayName change doesn't reflect. But I were successgul in changing description. I am adding my code here private void button2_Click(object sender, System.EventArgs e) { ServiceController obj = new ServiceController("Telephony"); Microsoft.Win32.RegistryKey objReg; string str = obj.DisplayName; try { ServiceControllerEx objSercEx =new ServiceControllerEx("Telephony"); string strDes = objSercEx.Description; objReg = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"System\CurrentControlSet\Services\tapisrv",true); objReg.SetValue("DisplayName","Telephony5678"); objReg.SetValue("Description", "DEscription"); objReg.Close(); } catch(Exception ex) { MessageBox.Show(ex.Message); } }

              L Offline
              L Offline
              leppie
              wrote on last edited by
              #6

              Create the ServiceController instance AFTER you change the value. xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups