Windows Service Urgent!!!
-
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
-
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
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!
-
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!
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
-
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
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!
-
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!
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); } }
-
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); } }
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!