The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Executing Commands Against a Windows Service

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Doug Thews

Posts: 866
Nickname: dougthews
Registered: Jul, 2003

Doug Thews is a software developer/manager for D&D Consulting Services with 18+ years of experience
Executing Commands Against a Windows Service Posted: Nov 6, 2004 2:38 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Doug Thews.
Original Post: Executing Commands Against a Windows Service
Feed Title: IlluminatiLand
Feed URL: http://apps5.oingo.com/apps/domainpark/domainpark.cgi?client=netw8744&s=JETBRAINS.COM
Feed Description: A technology blog for people enlightened enough to think for themselves
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Doug Thews
Latest Posts From IlluminatiLand

Advertisement

I've seen a lot of questions regarding problems trying to execute a custom command against a Windows Service. This assumes that you've already implemented an OnCustomCommand procedure inside your .NET code for the service and you're running it with valid permissions.

One of the most common errors when executing the code:

myServiceController.ExecuteCommand(iCode)

Is that you get an exception back that says:

"Cannot control service xxx on machine 'machine_name'"

Well, there's a single sentence of documentation on MSDN that explains the probable cause. It says that custom commands MUST be in the range of 128-255. Numbers under 128 are reserved for system-reserved values. It doesn't say anything about what numbers above 255 are used for.

So, for those of you having trouble sending custom commands to your Windows Service, try changing the command numbers to this valid range and it should fix your problem.

See the MSDN document here.

Read: Executing Commands Against a Windows Service

Topic: CSS and Firefox Previous Topic   Next Topic Topic: New IE Flaw, but maybe not for XPSP2

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use