Solved

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

Posted on 2004-09-09
6
4,762 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 85

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

If you build your web application in Visual Studio you'll get at least a few binaries, or .DLL, files in your bin folder. However, there is more compiling to be done. Normally this would happen when an ASP.NET resource within the web site is request…
It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

617 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