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
Solved

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

Posted on 2004-09-09
6
4,667 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 84

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RemoteApp Printing 5 101
Looking to exFAT Driver for Win XP 11 11,398
Virtual PC for Windows 10 18 258
Exchange & AD management console 2 112
Are you unable to synchronize your OST (Offline Storage Table) file with Microsoft Exchange Server? Is your OST file exceeding 2 GB size limit? In Microsoft Outlook 2002 and earlier versions, there is a 2 GB size limit for the OST file. If the file …
Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

860 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