Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-09-09
6
Medium Priority
?
4,812 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 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
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, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

730 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