Solved

use SC.exe to create local service... what's wrong

Posted on 2004-09-09
6
4,616 Views
Last Modified: 2011-05-10
from a command box typing

sc create myservname binPath=c:\windows\appname.exe type=own start=auto DisplayName=MyServName depend=server


returns this less than helpful message

Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ] <option1> <option2>...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
 type= <own|share|interact|kernel|filesys|rec>
       (default = own)
 start= <boot|system|auto|demand|disabled>
       (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= <BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <Dependencies(separated by / (forward slash))>
 obj= <AccountName|ObjectName>
       (default = LocalSystem)
 DisplayName= <display name>
 password= <password>


Without using FireDaemon how to I get this application to run as an autostart service?  I want the service to be started by the time the user hits the desktop, but I don't want to launch the application from the StartUp group or common start app points in the registry

0
Comment
Question by:paradoxloss
6 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 60 total points
ID: 12022245
If this application is not coded as a service, you will need a 3rd party tool or svrany.exe from the resource kit (or from http://www.dynawell.com/reskit/microsoft/win2000/srvany.zip)
0
 
LVL 34

Assisted Solution

by:sramesh2k
sramesh2k earned 400 total points
ID: 12023382
Srvany a part of Windows XP / 2003 resource kit tools
free download from:

Download details: Windows Server 2003 Resource Kit Tools:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en


137890 - How To Create a User-Defined Service:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q137/8/90.asp&NoWebContent=1

0
 

Author Comment

by:paradoxloss
ID: 12023718
Thanks, Sranmesh2k.  I was able to create the service placeholder with

INSTSRV MyService c:\windows\srvany.exe

I changed the ImagePath key to the application I wanted to run.  From the services applet I "start"ed the new service.  I saw the exe load in taskman, but the applet returned this error and killed the application:

Could not start the MyService service on Local Computer.

Error 1053: The service did not respond to the start or control request in a timely fashion.


The application in question keeps track of seen URLs and needs access to the internet.    I remember reading a similar article dated 2000 for Windows NT about running a service as a Local Service or System.  Right now it's trying to run as System.  How can I change it to Local Service?  Do I need to?  Is that the function of the Type or Start key?


thanks





0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 83

Assisted Solution

by:oBdA
oBdA earned 40 total points
ID: 12024364
Just for the record and maybe further use: the problem in your sc command line was in fact answered by the "less than helpful message", event though you have to look pretty hard to find it; you need to enter a space after the equal sign (for every option used in the sc command).
sc create myservname binPath= c:\windows\appname.exe type= own start= auto DisplayName= MyServName depend= server
0
 

Author Comment

by:paradoxloss
ID: 12031328
Yeah I noticed the space and I tried it that way too without success.  I think I'll try SC w/spaces and svrany.exe again tomorrow.
0
 

Expert Comment

by:swz03f
ID: 25722898
Thanks oBdA - that was causing some frustration!  Using spaces works.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now