How to design a script (or someone has one) that could start and stop services, saved as a file and run by double-clicking its icon.
Thanks
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » Developers, developers, developers » DevOps Lounge » Design a script using PowerShell
Hi BATcher,
In Windows 7 System Conmfiguration/Services, there are a number of services such as
ApplicationEXperience/Application Identity/Windows Audio/ActiveX Installer/computer Browser
and the list goes on.
I would like to stop a number of these services to relieve the load on the processor. I can do it
manually by using the System Configuration panel.
I would like to automate the stopping of a certain of these services by clicking an icon.
Thanks
I would suggest you are not going to get the result you require, because an idle service imposes almost zero load on the processor.
But if you want to go ahead…
SC STOP servicename1
SC STOP servicename2
and so on
You now have a Stop Service icon on the desktop on which you can click.
Do the same to create a StartServ.bat file, but of course using
SC START servicename1
and so on
To find the correct service names for the services you want to stop or start, do something like
SC QUERY > ListOfServices.txt
and inspect the resulting (large!) file with something like NOTEPAD.
For each service you will find
You can use either of these where I have put servicename1, servicename2, etc, above – but make sure that the display name is in double-quotes, example
SC STOP wuauserv
or
SC STOP “Windows Update”
(Don’t actually STOP Windows Update – it is just an example!)
Undoubtedly for each desktop icon you will need to go into its Properties, select the Shortcut tab, click on the Advanced button, and put a tick in the box in front of Run as Administrator.
I hope that will enable you to do what you want.
BATcher
Plethora means a lot to me.
Thank you and I will try it out after figuring out the procedure to create batch file.
To create a batch file, open Notepad, write the script and then save thusly:
Select as file type as all files, not as .txt. (from the dropdown menu at the bottom of the save dialogue box)
Name the file and give it the file extension .bat for example myscript.bat
Now when you double this bat file, assuming your script is good, it will run…
I’ve been using this ‘Command Line Crash Course’ to learn quickly learn commands in Windows Power Shell and I really like it. Maybe you might enjoy it too: http://cli.learncodethehardway.org/book/
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications