Groups | Blog | Home
all groups > dotnet myservices > january 2007 >

dotnet myservices : Passing parameter to windows service...


Hakan_Örnek
1/14/2007 4:00:45 PM
Hi ,
I want to parameter passing to my windows sevice. I call service =
commands like this ;
'------------------------------------------------------------
Dim sc As ServiceController
sc =3D New ServiceController("ProsetLogServices")
sc.MachineName =3D "."
If sc.Status =3D ServiceControllerStatus.Stopped Then
sc.Start()
End If
sc.ExecuteCommand(129)
'------------------------------------------------------------
This is working but how can I passing parameters to windows service =
function...

Lee Gillie
1/19/2007 3:29:24 PM
[quoted text, click to view]
Service start parameters are part of the SCM registration of the
service, that is, stored in the SCM database which is housed in the
registry, these are not call paramters to the start function. If you
have information to tell the service about how it should start you need
to store that in a pre-agreed location. An alternative might be to
modify the registration of the service before starting it, but this is
risky, because although it is relatively stable, it is the domain of the
SCM to read and write data from here, which means its format could
AddThis Social Bookmark Button