Results 1 to 7 of 7

Thread: Disable Service from Command Prompt

  1. #1
    AO French Antique News Whore
    Join Date
    Aug 2001
    Posts
    2,126

    Disable Service from Command Prompt

    I google that realy fast and found nothing that worth it. (A lot of info how to disable a service from Microsolf Management Console and that it).

    So does anyone know how to disable service from a command prompt?

    I want to make a batch file to run on my network computer that will change the startup settings of some service. (Messenger, Alerter, Etc)
    -Simon \"SDK\"

  2. #2
    net stop?

    Syntax: net stop <service>


    This will stop the service, not disable it. But if the script runs each time they login, then it won't matter.
    Tachyon

    |-----|Alcohol is my anti-drug |-----|

  3. #3
    AntiOnline n00b
    Join Date
    Feb 2004
    Posts
    666
    Hi

    You can use NET START and NET STOP to stop or start a servic.......or are you looking for something else

    sc query <servicename> will give you status on any service whether it is started or not

    http://www.blackviper.com/WIN2K/servicecfg.htm

    --GooD Luck--

    [Edit] I am Damm Slow somebody Beat me to it i need to increase my Typing Speed

  4. #4
    AO übergeek phishphreek's Avatar
    Join Date
    Jan 2002
    Posts
    4,325
    If you have the resource kit installed you can also use the service.vbs

    C:\Documents and Settings\user&gt;service /?
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.


    Controls services on a machine.

    SYNTAX:
    1. Service.vbs /L
    [/S &lt;server&gt;][/U &lt;username&gt;][/W &lt;password&gt;]
    [/O &lt;outputfile&gt;]

    2. Service.vbs /G | /X | /R | /D | /M &lt;StartMode&gt;
    /N &lt;service&gt;
    [/S &lt;server&gt;][/U &lt;username&gt;][/W &lt;password&gt;]
    [/O &lt;outputfile&gt;]

    3. Service.vbs /I /E &lt;execname&gt; /N &lt;service&gt; [/C &lt;DisplayName&gt;]
    [/S &lt;server&gt;][/U &lt;username&gt;][/W &lt;password&gt;]
    [/O &lt;outputfile&gt;]

    PARAMETER SPECIFIERS:
    /L List all Services
    /D List Service dependencies
    /G Start a Service
    /X Stop a Service
    /R Remove a Service
    /M Set the Service Mode
    /I Install a service
    /E The Full path and filename of the service
    StartMode The Service Startup Setting.
    Service A Service Name
    DisplayName The Service name that appears in the listing/
    server A machine name.
    username The current user's name.
    password Password of the current user.
    outputfile The output file name.

    EXAMPLE:
    1. cscript Service.vbs /L /S MyMachine2
    List installed services for the machine MyMachine2.
    2. cscript Service.vbs /X /N snmp
    Stops the snmp service on the current machine.
    EDIT: I'll attach service.vbs in a file called service.zip for ya just in case you want it.
    Quitmzilla is a firefox extension that gives you stats on how long you have quit smoking, how much money you\'ve saved, how much you haven\'t smoked and recent milestones. Very helpful for people who quit smoking and used to smoke at their computers... Helps out with the urges.

  5. #5
    Senior Member
    Join Date
    Apr 2004
    Posts
    1,130
    or use SC by itself

    http://www.microsoft.com/resources/d.../en-us/sc.mspx

    "Communicates with the Service Controller and installed services. SC.exe retrieves and sets control information about services. You can use SC.exe for testing and debugging service programs. Service properties stored in the registry can be set to control how service applications are started at boot time and run as background processes. SC.exe parameters can configure a specific service, retrieve the current status of a service, as well as stop and start a service. You can create batch files that call various SC.exe commands to automate the startup or shutdown sequence of services. SC.exe provides capabilities similar to Services in the Administrative Tools item in Control "

    Syntax
    sc [ServerName] config [ServiceName] [type= {own|share|kernel|filesys|rec|adapt|interact type= {own|share}}] [start= {boot|system|auto|demand|disabled}] [error= {normal|severe|critical|ignore}] [binpath= BinaryPathName] [group= LoadOrderGroup] [tag= {yes|no}] [depend= dependencies] [obj= {AccountName|ObjectName}] [displayname= DisplayName] [password= Password]
    Meu sítio

    FORMAT C: Yes ...Yes??? ...Nooooo!!! ^C ^C ^C ^C ^C
    If I die before I sleep, I pray the Lord my soul to encrypt.
    If I die before I wake, I pray the Lord my soul to brake.

  6. #6
    AO French Antique News Whore
    Join Date
    Aug 2001
    Posts
    2,126
    Thank guy! I use the "sc config Alerter start= disabled" command and it work good! You made me happy! Greenie for you 3!
    -Simon \"SDK\"

  7. #7
    get the sysinternals pstools. Its awesome. I use it all the time when some of the designers and developers have too many services running on their PCs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •