Stop All Services

This is a Windows Script Host script written in JScript to stop as many running Services as possible on a Windows PC. Not all services can be stopped, but this one stops as many as it can.

It calls the Windows Management Instrumentation object to retrieve the currently running Services and terminate them and their dependencies in an orderly fashion. There probably will still be other processes that need to be terminated via the Task Manager, this script only shuts down Services, which is really tedious to do by hand.

Shutting off all running Services is especially useful before you defragment a hard disk, in order to release all locked files that are held. If you don't try to eliminate as many running processes as possible, the defragmentation will be less effective.

Note: This script doesn't stop any programs entered in the Registry which may run at startup. You may want to run this script a few times, as it sometimes doesn't knock out all possible services in one go.

Command line:

cscript stop-all-services.js


C:\>cscript stop-all-services.js
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Run One.
Stopping: ALG
Stopping: AudioSrv
Stopping: CryptSvc
Stopping: Dhcp
Stopping: dmserver
Stopping: Dnscache
Stopping: +---SENS
Stopping: EventSystem
Stopping: FastUserSwitchingCompatibility
Stopping: lanmanserver
Stopping: lanmanworkstation
Stopping: LmHosts
Stopping: +---SharedAccess
Stopping: Netman
Stopping: Nla
Stopping: PolicyAgent
Stopping: ProtectedStorage
Stopping: SENS
Stopping: SharedAccess
Stopping: ShellHWDetection
Stopping: Spooler
Stopping: SSDPSRV
Stopping: Themes
Stopping: TrkWks
Stopping: VBoxService
Stopping: W32Time
Stopping: WZCSVC
Run Two.
Stopping: winmgmt


stop-all-services.js file