Re: Installing service with automatic startup from command prompt

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



From: "aaa" <aaa@xxxxxxxxxxxxxxxxxxxxxxxxx>

| Is there a way to install a Windows service from the command prompt and at
| the same time set the "Startup type" to automatic?

You would need the Resource Kit utility; INSTSRV.EXE

And run it such as; instsrv MyServiceName MyServiceEXE_path

Then you can use the SC command such as...

sc config MyServiceName start= auto

You would have to read the instructions on how to properly use the INSTSRV.EXE utility.

I used this process to create a Seti@Home service to run the SETI Command Line version.

InstallSeti.BAT
----------------------
@echo off
copy ".\SaH\*.*" %windir% >nul
%windir%\instsrv MySeti %windir%\srvany.exe
regedit /s .\sah_servXP.reg
sc config MySeti start= auto
c:
cd %windir%
cmd



sah_servXP.reg
--------------------------------

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySeti]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySeti\Parameters]
"Application"="c:\\windows\\MySeti.exe"
"AppDirectory"="c:\\windows"


--
Dave
http://www.claymania.com/removal-trojan-adware.html
http://www.ik-cs.com/got-a-virus.htm


.



Relevant Pages

  • RE: Unknown Windows Service suspected Worm/Virus
    ... I have no idea what the service is, but maybe a scrape of the registry ... If anyone can identify this windows service please respond. ... Please also respond with the command line to stop a service. ... Gain the in-demand skills of ...
    (Security-Basics)
  • Re: Cannot run a command process from a Windows Service
    ... will consider an alternative to the Windows service. ... I am trying to run a command, which I would normally run from ... Note that you need to create a logon session for the ... load user profile and environment before creating the child process ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Ingres R3 Win Shutdown via command line
    ... >> Assuming that the DBMS is started as a service, this command should ... The "-service" parameter will start or stop the Windows service, ... Note also that on my machine the service is named "Ingres Intelligent ...
    (comp.databases.ingres)
  • Re: Implementing scheduler in web service
    ... Create a windows service which does the scheduler job to fire some command ... Create a webservice as a monitoring/controlling service for the windows ... I would like to use web service interface to control the ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: WIndows Service and Standalone
    ... Sub Main check for any command line args. ... You could use the args to determine how you want your app to start. ... If you want it to run in command line mode, you could use a windows form. ... I want a single executable to be able to run as a Windows Service or from ...
    (microsoft.public.dotnet.general)