![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| VISTA ULTIMATE 32BIT | How to make a batch file on starting and stopping services from command prompt ? does anyone know how to make a batch file where you could start ,disable , stop and manual for a service from the command prompt ? for example instead of going to services.msc and right clicking on a service then clicking on properties then making the startup to be manual,automatic or disable . I could do with a batch file where i would just launch the batch file and it would make the startup to manual and then disable the service that i want to disable. |
My System Specs![]() |
| | #2 (permalink) |
| Vista Ultimate x64 SP1 | Re: How to make a batch file on starting and stopping services from command prompt ? Aside from the obvious, what is it you're trying to accomplish? What services do you want disabled at one time but not another? |
My System Specs![]() |
| | #3 (permalink) |
| Windows 7 Ultimate x64 | Re: How to make a batch file on starting and stopping services from command prompt ? net start <service name> net stop <service name> |
My System Specs![]() |
| | #4 (permalink) |
| VISTA ULTIMATE 32BIT | Re: How to make a batch file on starting and stopping services from command prompt ? I want to know how I could make a service start manually or autmatically or disable from a command prompt by making a batch file. Instead of right-clicking on a service then going to properties and then click on the down arrow on startup and point to "automatic,disable or manual". Its for work. I know about net start " service name " and net stop " service name " . I'm trying to have it where it disables a service and I could make it manual instead of automatic from the batch file. |
My System Specs![]() |
| | #5 (permalink) |
| Vista Ultimate x64 MAK, OpenSolaris 5, Gentoo 2008.1.... | Re: How to make a batch file on starting and stopping services from command prompt ? |
My System Specs![]() |
| | #6 (permalink) |
| Vista Ultimate x64 SP1 | Re: How to make a batch file on starting and stopping services from command prompt ? Seriously, I want to learn something here. I understand what you're trying to do, but what I want to know is why? What are the practical applications of doing this? |
My System Specs![]() |
| | #7 (permalink) |
| Vista Ultimate x64 MAK, OpenSolaris 5, Gentoo 2008.1.... | Re: How to make a batch file on starting and stopping services from command prompt ? Simple - an easy way to disable services - some services are in automatic mode and will auto start themselves even if you stop them - Indexing for example. |
My System Specs![]() |
| | #8 (permalink) |
| VISTA ULTIMATE 32BIT | Re: How to make a batch file on starting and stopping services from command prompt ? Johngalt, SC? What I'm trying to do is from the command prompt(cmd) is to make a service manual then disable it then start it again. I want that as a batch file .So when I run the batch file thats what it does. If you can tell me how that would be great. |
My System Specs![]() |
| | #9 (permalink) |
| Vista Ultimate x64 MAK, OpenSolaris 5, Gentoo 2008.1.... | Re: How to make a batch file on starting and stopping services from command prompt ? Did you bother to read that link? Code: DESCRIPTION:
SC is a command line program used for communicating with the
Service Control Manager and services.
USAGE:
sc <server> [command] [service name] <option1> <option2>...
The option <server> has the form "\\ServerName"
Further help on commands can be obtained by typing: "sc [command]"
Commands:
query-----------Queries the status for a service, or
enumerates the status for types of services.
queryex---------Queries the extended status for a service, or
enumerates the status for types of services.
start-----------Starts a service.
pause-----------Sends a PAUSE control request to a service.
interrogate-----Sends an INTERROGATE control request to a service.
continue--------Sends a CONTINUE control request to a service.
stop------------Sends a STOP request to a service.
config----------Changes the configuration of a service (persistent).
description-----Changes the description of a service.
failure---------Changes the actions taken by a service upon failure.
failureflag-----Changes the failure actions flag of a service.
sidtype---------Changes the service SID type of a service.
privs-----------Changes the required privileges of a service.
qc--------------Queries the configuration information for a service.
qdescription----Queries the description for a service.
qfailure--------Queries the actions taken by a service upon failure.
qfailureflag----Queries the failure actions flag of a service.
qsidtype--------Queries the service SID type of a service.
qprivs----------Queries the required privileges of a service.
delete----------Deletes a service (from the registry).
create----------Creates a service. (adds it to the registry).
control---------Sends a control to a service.
sdshow----------Displays a service's security descriptor.
sdset-----------Sets a service's security descriptor.
showsid---------Displays the service SID string corresponding to an arbitrary name.
GetDisplayName--Gets the DisplayName for a service.
GetKeyName------Gets the ServiceKeyName for a service.
EnumDepend------Enumerates Service Dependencies.
The following commands don't require a service name:
sc <server> <command> <option>
boot------------(ok | bad) Indicates whether the last boot should
be saved as the last-known-good boot configuration
Lock------------Locks the Service Database
QueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:
sc start MyService
Would you like to see help for the QUERY and QUERYEX commands? [ y | n ]:
|
My System Specs![]() |
| | #10 (permalink) |
| VISTA ULTIMATE 32BIT | Re: How to make a batch file on starting and stopping services from command prompt ? Did you bother to read that link? Code: DESCRIPTION:
SC is a command line program used for communicating with the
Service Control Manager and services.
USAGE:
sc <server> [command] [service name] <option1> <option2>...
The option <server> has the form "\\ServerName"
Further help on commands can be obtained by typing: "sc [command]"
Commands:
query-----------Queries the status for a service, or
enumerates the status for types of services.
queryex---------Queries the extended status for a service, or
enumerates the status for types of services.
start-----------Starts a service.
pause-----------Sends a PAUSE control request to a service.
interrogate-----Sends an INTERROGATE control request to a service.
continue--------Sends a CONTINUE control request to a service.
stop------------Sends a STOP request to a service.
config----------Changes the configuration of a service (persistent).
description-----Changes the description of a service.
failure---------Changes the actions taken by a service upon failure.
failureflag-----Changes the failure actions flag of a service.
sidtype---------Changes the service SID type of a service.
privs-----------Changes the required privileges of a service.
qc--------------Queries the configuration information for a service.
qdescription----Queries the description for a service.
qfailure--------Queries the actions taken by a service upon failure.
qfailureflag----Queries the failure actions flag of a service.
qsidtype--------Queries the service SID type of a service.
qprivs----------Queries the required privileges of a service.
delete----------Deletes a service (from the registry).
create----------Creates a service. (adds it to the registry).
control---------Sends a control to a service.
sdshow----------Displays a service's security descriptor.
sdset-----------Sets a service's security descriptor.
showsid---------Displays the service SID string corresponding to an arbitrary name.
GetDisplayName--Gets the DisplayName for a service.
GetKeyName------Gets the ServiceKeyName for a service.
EnumDepend------Enumerates Service Dependencies.
The following commands don't require a service name:
sc <server> <command> <option>
boot------------(ok | bad) Indicates whether the last boot should
be saved as the last-known-good boot configuration
Lock------------Locks the Service Database
QueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:
sc start MyService
Would you like to see help for the QUERY and QUERYEX commands? [ y | n ]:
Yes I did. Still stuck on how I would go about writing a .bat file so when I launch the .bat file. It makes a service to manual in the startup choice then disables it then starts it. By the way how did you get the entire thing from command prompt to show up from the SC /? I type that and it goes down but doesn't show me the top portion. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Starting & stopping services | VB Script | |||
Make a command prompt run a command as soon as it opens? | General Discussion | |||
| recovery from command prompt starting from install dvd | Vista General | |||
| 10 seconds delay when starting 'command prompt' | Vista General | |||
| Get-WmiObject and starting/stopping remote services | PowerShell | |||