473,320 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

NT service (setting Description string)

Anybody know what variable I need to define in my
class to set the long description that shows up
in the Services control panel applet?

_svc_name_ holds the short name
_svc_display_name_ holds the long name
_svc_?????_ holds the description

Thanks, Larry
Jul 18 '05 #1
2 1786
"Larry Bates" <lb****@swamisoft.com> writes:
Anybody know what variable I need to define in my
class to set the long description that shows up
in the Services control panel applet?

_svc_name_ holds the short name
_svc_display_name_ holds the long name
_svc_?????_ holds the description


There isn't any yet. Apparently you have to call the win32 api
ChangeServiceConfig2() (but maybe it can also be done with the wmi
module).

Thomas
Jul 18 '05 #2
I found a way to do this that seems to make
sense. You can modify the Description in
the registry using _winreg. The value
is located at:

HMLM\SYSTEM\CurrentControlSet\Services\<servicenam e>

I then installed the code below in the main
program of the service (that gets executed
when the service is installed). This way
the registry gets "fixed" every time the
service is installed or removed. Seems to
work pretty well.

Thanks for the input from everyone.

Larry Bates
if __name__ == "__main__":
import sys
import _winreg
#
# Following line handles install/remove/start/stop commands from the
command line
#
win32serviceutil.HandleCommandLine(AFRservice)
try: cmd=sys.argv[1].upper()
except: sys.exit()

if cmd == 'INSTALL':
print "Calling win32evtlogutil.AddSourceToRegistry for AFR
Application"

win32evtlogutil.AddSourceToRegistry('AFR','C:\Pyth on22\Lib\site-Packages\win
32\servicemanager.pyd',
'Application')

#
# Update the description of this service in the registry
#

#---------------------------------------------------------------------
# Open registry at the proper key

#---------------------------------------------------------------------
regkey='SYSTEM\CurrentControlSet\Services\AFR'
key=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, regkey, 0,
_winreg.KEY_SET_VALUE)
description='AFR provides automated routing for inbound faxes that
are ' \
'received by Castelle Faxpress fax server. Faxes are
converted ' \
'to .PDF files and routed via SMTP email to users based
on ' \
'routing rules.'

_winreg.SetValueEx(key, 'Description', 0, _winreg.REG_SZ,
description)

elif cmd == 'REMOVE':
print "Calling win32evtlogutil.RemoveSourceFromRegistry for AFR
Application"
win32evtlogutil.RemoveSourceFromRegistry('AFR','Ap plication')

"Larry Bates" <lb****@swamisoft.com> wrote in message
news:jJ********************@comcast.com...
Anybody know what variable I need to define in my
class to set the long description that shows up
in the Services control panel applet?

_svc_name_ holds the short name
_svc_display_name_ holds the long name
_svc_?????_ holds the description

Thanks, Larry

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David Norris | last post by:
I have created a simply Windows Service which installs, starts, stops, etc just fine. I'm confused by the fact that even though the service shows up in the Computer Management Services list there...
2
by: Paul Hale | last post by:
I have a vb.net web service and client that are both working fine. If someone wanted to consume our web service using .NET, no problem. Im a little confused on how non .NET clients would use the...
2
by: Greg | last post by:
Please note: I have cross posted this from Newsgroup: microsoft.public.dotnet.framework.aspnet.webservices with a few minor changes... I am having a simple problem setting up the security on my...
3
by: Jim Lewis | last post by:
I have read several things that state accessing a Web Service through a Query String should work. However, when I try to execute http://localhost/webservice1/service1.asmx/HelloWorld I get the...
2
by: letibal | last post by:
Hello, I have written a windows service and created an installer for it. The service runs under the system accounts. When started, it launches a GUI. By default, the InteractiveProcess property...
3
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
2
by: | last post by:
Hi all, I have an asp.net 2.0 website that accesses a locally hosted web service. This works fine on servers that are connected to our network. However, I am having a problem with a laptop...
3
by: Anil S | last post by:
Hello, my application is console application and I have created "Service Reference" of the webservices. this webservice uses username and password. my code are following: myArray nl; ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.