How to pass a start parameters to Windows Service

E

Eric Chong

I created a Windows Service in C# that requires to get
passed command arguments like a Console App. I noticed
that there is an option "Start parameters" text box in
the property of a Windows Service in MMC. Is there any
way to get arguments using this option? If possible, what
framework method should I use to get an arguement?
Thanks in advance.

Eric
 
J

Jeffrey Tan[MSFT]

Hi Eric,

I think you can use WMI to get this property.
For more details, I will do some research for you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Eric Chong" <[email protected]>
| Sender: "Eric Chong" <[email protected]>
| Subject: How to pass a start parameters to Windows Service
| Date: Fri, 5 Sep 2003 11:12:02 -0700
| Lines: 9
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNz2TR6u0M+7LjdQrSdpKUorgvuVg==
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:19222
| NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| I created a Windows Service in C# that requires to get
| passed command arguments like a Console App. I noticed
| that there is an option "Start parameters" text box in
| the property of a Windows Service in MMC. Is there any
| way to get arguments using this option? If possible, what
| framework method should I use to get an arguement?
| Thanks in advance.
|
| Eric
|
 
J

Jeffrey Tan[MSFT]

Hi Eric,

I found that this post had been posted in several groups.
A member of our team has replied your question in
microsoft.public.dotnet.general
He will follow up you there.
Thanks for you understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Eric Chong" <[email protected]>
| Sender: "Eric Chong" <[email protected]>
| Subject: How to pass a start parameters to Windows Service
| Date: Fri, 5 Sep 2003 11:12:02 -0700
| Lines: 9
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNz2TR6u0M+7LjdQrSdpKUorgvuVg==
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:19222
| NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| I created a Windows Service in C# that requires to get
| passed command arguments like a Console App. I noticed
| that there is an option "Start parameters" text box in
| the property of a Windows Service in MMC. Is there any
| way to get arguments using this option? If possible, what
| framework method should I use to get an arguement?
| Thanks in advance.
|
| Eric
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top