Batch Scripting

Discussion in 'Web Design & Coding' started by Ops, Jan 5, 2004.

  1. Ops

    Ops VIP Member

    Joined:
    Jul 20, 2003
    Messages:
    178
    Likes Received:
    0
    Location:
    Everywhere
    Is there a way to turn off services through a batch file? I mean is there a list of names in the cmd for a specific service?
     
    Ops, Jan 5, 2004
    #1
    1. Advertisements

  2. Ops

    Core in pounce mode Moderator

    Joined:
    Jun 30, 2003
    Messages:
    1,557
    Likes Received:
    24
    Location:
    Akaa, Finland
    You should be able to use the SC STOP command for that.


    You're using XP, right? Click on Start/Help and Support and run a search for 'sc' to get more information on SC.
     
    Core, Jan 5, 2004
    #2
    1. Advertisements

  3. Ops

    Ops VIP Member

    Joined:
    Jul 20, 2003
    Messages:
    178
    Likes Received:
    0
    Location:
    Everywhere
    how can I use this to disable them? So stop, then disable?
     
    Ops, Jan 5, 2004
    #3
  4. Ops

    Core in pounce mode Moderator

    Joined:
    Jun 30, 2003
    Messages:
    1,557
    Likes Received:
    24
    Location:
    Akaa, Finland
    SC DELETE

    Deletes a service subkey from the registry. If the service is running or if another process has an open handle to the service, then the service is marked for deletion.

    Syntax
    sc [ServerName] delete [ServiceName]

    Parameters

    ServerName
    Specifies the name of the remote server on which the service is located. The name must use the UNC format ("\\myserver"). To run SC.exe locally, ignore this parameter.

    ServiceName
    Specifies the service name returned by the getkeyname operation.

    /?
    Displays help at the command prompt.

    Remarks
    Use Add or Remove Programs to delete DHCP, DNS, or any other built-in operating system services. Add or Remove Programs will not only remove the registry subkey for the service, but it will also uninstall the service and delete any shortcuts to the service.

    Examples

    The following example shows how you can use the sc delete command:

    sc delete newserv


    --

    I've never used it myself, so...proceed at own risk.
     
    Core, Jan 5, 2004
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.