OpenSCManager FAILED 1722 RPC server is unavailable; windows services


T

TJ

I created a windows service using VS2005.
I created/adjusted the install class using the designer controls.
I set the user to be 'local system'.
I installed the service using the VS2005 cmd console (installutil.exe).
The service shows up fine in my services snap-in.
I can start and stop it just fine and it works great when I start it.
I can open a command window and type: net start "My Service" and net stop
"My Service" and it works great.

I have a program that must start the service like this:
c:\windows\system32\sc.exe \\mymachinename start "My Service"

Now is when my problem arises. Using the sc.exe (like in the line above) to
start/stop the service throws the following error:
[SC] OpenSCManager FAILED 1722:
The RPC server is unavailable.

This is on Win2003SvrSP1
Using some rpc tools in the Windows Resource Kit didn't reveal anything -
though I don't have much experience w/ those tools and could have not
testing something correctly.
The RPC server service is started. Again, my custom windows service works
just fine if I start/stop in the mmc or use 'net start/stop' from a command
line. I just can't for the life of me get sc.exe to start/stop it w/o
throwing that 'RPC server is unavailable' error.

I mean everything was done clean and out of the box. It's practically a
HelloWorld windows service created in VS2005 C# and immediately installed
using installutil.exe all self contained on a single Win2003Svr machine.
This should be a textbook helloworld windows service. Does anyone know how
I can use sc.exe to start/stop w/o throwing that awful error?
 
Ad

Advertisements

T

TJ

Because the service I'll be calling is installed on the same machine as the
bat file that is calling it, I don't necessarily have to use sc.exe and it's
remote capabilities. But I also can't use net start/stop either. But I
found netsvc.exe in one of the old nt resource toolkits - and it does
exactly what I need it to do.
 

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

Top