Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-09-09
6
Medium Priority
?
4,858 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 240 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 1600 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 85

Assisted Solution

by:oBdA
oBdA earned 160 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

885 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