I came up with a list of services and startup types and put them in a tab-delimited file. My script reads this file from the same directory and name as the script (except that it's a .txt not a .cmd file).
IMPORTANT: The following line should have a TAB in it, not 4 spaces:
Batch:
for /f "tokens=1-5 delims= " %%a in (%~n0.txt) do (
IMPORTANT TWO: The accompanying text file needs to be TAB-DELIMITED, so if you use this, you'll have to replace four spaces with a TAB (I think).
Script - Win11_Svc_Defaults.cmd
Batch:
@echo off
) <ecjb@ecjb.net> 8/30/2024
)
cls
net session 2> nul:
if errorlevel 1 (
echo This script must be run as an administrator.
echo You are not running this script with admin privileges.
pause
goto :eof
)
pushd "%~dp0"
if not exist "%~n0.txt" (
echo This script looks for a tab-delimited text file of the same name in the
echo current directory. The file %~n0.txt was not found.
pause
goto :eof
)
).
for /f "tokens=1-5 delims= " %%a in (%~n0.txt) do (
echo Setting %%a / %%c to startup type %%d...
sc config %%c start= %%b
if not "%%e" == "" (
for /f "tokens=1,4" %%m in ('sc query "%%c"') do (
if /i "%%m" == "State" (
if /i "%%n" neq "Running" (
echo Attempting to start service %%a / %%c...
sc start %%c
)
)
)
)
)
echo.
echo All done...
pause
popd
Data file - Win11_Svc_Defaults.txt
IMPORTANT: This should be TAB-DELIMITED, but pasting it here turned tabs into spaces.
Code:
Active-X Installer demand AxInstSV Manual
Adaptive Brightness demand SensrSvc Manual
Agent Activation Runtime demand AarSvc Manual
AllJoyn Router Service demand AJrouter Manual
App Readiness demand AppReadiness Manual
Application Experience demand AeLookupSvc Manual Running
Application Identity demand AppIDSvc Manual
Application Information demand Appinfo Manual Running
Application Layer Gateway Service demand ALG Manual
Application Management demand AppMgmt Manual
AppX Deployment Service demand AppXSCV Manual
AssignedAccessManager demand AssignedAccessManagerSvc Manual
Auto Time Zone Updater demand tzautoupdate Manual
AVCTP service demand BthAvctpSvc Manual
Background Intelligent Transfer Service delayed-auto BITS Automatic (Delayed start) Running
Background Tasks Infrastructure Service auto BrokerInfrastructure Automatic
Base Filtering Engine auto BFE Automatic Running
BcastDVRUserService auto BcastDVRUserService Automatic
BitLocker Drive Encryption Service demand BDESVC Manual
Block Level Backup Engine Service demand wbengine Manual
Bluetooth Audio Gateway Service demand BTAGService Manual
Bluetooth Support Service demand bthserv Manual
Bluetooth User Support Service demand BluetoothUserService_562a9 Manual
BranchCache demand PeerDistSvc Manual
Capability Access Manager Service delayed-auto camsvc Automatic (Delayed start)
CaptureService demand CaptureService Manual
Cellular Time demand autotimesvc Manual
Certificate Propagation demand CertPropSvc Manual
Client License Service (ClipSVC) demand ClipSVC Manual
Clipboard User Service demand cbdhsvc Manual
CNG Key Isolation demand KeyIso Manual Running
COM+ Event System auto EventSystem Automatic Running
COM+ System Application demand COMSysApp Manual
Computer Browser demand Browser Manual
Connected Devices Platform Service delayed-auto CDPSvc Automatic (Delayed start)
Connected Devices Platform User Service auto CDPUserSvc Automatic Running
Connected User Experiences and Telemetry auto DiagTrack Automatic
ConsentUX User Service demand ConsentUxUserSvc Manual
Contact Data demand PimIndexMaintenanceSvc Manual
CoreMessaging auto CoreMessagingRegistrar Automatic
Credential Manager demand VaultSvc Manual
CredentialEnrollmentManagerUserSvc demand CredentialEnrollmentManagerUserSvc Manual
Cryptographic Services auto CryptSvc Automatic Running
Data Sharing Service demand DsSvc Manual
Data Usage auto CryptSvc Automatic Running
DCOM Server Process Launcher auto DcomLaunch Automatic Running
Delivery Optimization auto DoSvc Automatic Running
Desktop Window Manager Session Manager auto UxSms Automatic Running
Device Association Service demand DeviceAssociationService Manual
Device Install Service demand DeviceInstall Manual
Device Management Enrollment Service demand DmEnrollmentSvc Manual
Device Management Wireless Application Protocol demand dmwappushservice Manual
Device Setup Manager demand DsmSvc Manual
DeviceAssociationBroker demand DeviceAssociationBrokerSvc Manual
DevicePicker demand DevicePickerUserSvc Manual
DevicesFlow demand DevicesFlowUserSvc Manual
DevQuery Background Discovery Broker demand DevQueryBroker Manual
DHCP Client auto Dhcp Automatic Running
Diagnostic Execution Service demand diagsvc Manual
Diagnostic Policy Service auto DPS Automatic Running
Diagnostic Service Host demand WdiServiceHost Manual Running
Diagnostic System Host demand WdiSystemHost Manual
Display Enhancement Service demand DisplayEnhancementService Manual
Display Policy Service auto DispBrokerDesktopSvc Automatic Running
Disk Defragmenter demand defragsvc Manual
Distributed Link Tracking Client auto TrkWks Automatic Running
Distributed Transaction Coordinator demand MSDTC Manual Running
DNS Client auto Dnscache Automatic Running
Downloaded Maps Manager auto MapsBroker Automatic
EasyAntiCheat demand EasyAntiCheat Manual
Embedded Mode demand embeddedmode Manual
Encrypting File System (EFS) demand EFS Manual
Enterprise App Management Service demand EntAppSvc Manual
Extensible Authentication Protocol demand EapHost Manual
Fax demand Fax Manual
File History Service demand fhsvc Manual
Function Discovery Provider Host demand fdPHost Manual
Function Discovery Resource Publication auto FDResPub Automatic Running
GameDVR and Broadcast User Service demand BcastDVRUserService Manual
Geolocation Service demand lfsvc Manual
Google Chrome Elevation Service demand GoogleChromeElevationService Manual
Google Update Service delayed-auto gupdate Automatic (Delayed start)
Google Update Service demand gupdatem Manual
GraphicsPerfSvc demand GraphicsPerfSvc Manual
Group Policy Client auto gpsvc Automatic Running
Health Key and Certificate Management demand hkmsvc Manual
HomeGroup Listener demand HomeGroupListener Manual Running
HomeGroup Provider demand HomeGroupProvider Manual Running
Human Interface Device Access demand hidserv Manual
HV Host Service demand HvHost Manual
Hyper-V demand 8 Services Manual
IKE and AuthIP IPsec Keying Modules auto IKEEXT Automatic
Intel(R) Storage Middleware Service auto RstMwService Automatic
Interactive Services Detection demand UI0Detect Manual
Internet Connection Sharing (ICS) demand SharedAccess Manual
IP Helper auto iphlpsvc Automatic Running
IP Translation Configuration Service demand IpxlatCfgSvc Manual
IPsec Policy Agent demand PolicyAgent Manual
KtmRm for Distributed Transaction Coordinator demand KtmRm Manual
Language Experience Service demand LxpSvc Manual
Link-Layer Topology Discovery Mapper demand lltdsvc Manual
Local Profile Assistant Service demand wlpasvc Manual
Local Session Manager auto LSM Automatic
Machine Debug Manager (Visual Studio) delayed-auto MDM Automatic (Delayed start) Running
Media Center Extender Service disabled Mcx2Svc Disabled
MessagingService demand MessagingService Manual
Microsoft Account Sign-in Assistant demand wlidsvc Manual Running
Microsoft App-V Client disabled AppVClient Disabled
Microsoft Defender Antivirus Network Inspection Service demand WdNisSvc Manual
Microsoft Defender Antivirus Service auto WinDefend Automatic
Microsoft Diagnostics Hub Standard Collector Service demand diagnosticshub.standardcollector.service Manual
Microsoft Edge Elevation Service demand MicrosoftEdgeElevationService Manual
Microsoft Edge Update Service (edgeupdate) auto edgeupdate Automatic
Microsoft Edge Update Service (edgeupdatem) demand edgeupdatem Manual
Microsoft iSCSI Initiator Service demand MSiSCSI Manual
Microsoft Passport demand NgcSvc Manual
Microsoft Passport Container demand NgcCtnrSvc Manual
Microsoft Software Shadow Copy Provider demand swprv Manual
Microsoft Storage Spaces SMP demand smphost Manual
Microsoft Store Install Service demand InstallService Manual
Microsoft Windows SMS Router Service demand SmsRouter Manual
Multimedia Class Scheduler auto MMCSS Automatic Running
Natural Authentication demand NaturalAuthentication Manual
Net.Tcp Port Sharing Service disabled NetTcpPortSharing Disabled
Netlogon demand Netlogon Manual
Network Access Protection Agent demand napagent Manual
Network Connected Devices Auto-Setup demand NcdAutoSetup Manual
Network Connection Broker demand NcbService Manual
Network Connections demand Netman Manual
Network Connectivity Assistant demand NcaSvc Manual
Network List Service demand netprofm Manual Running
Network Location Awareness auto NlaSvc Automatic Running
Network Setup Service demand NetSetupSvc Manual
Network Store Interface Service auto nsi Automatic Running
Offline Files demand CscService Manual
OpenSSH Authentication Agent disabled ssh-agent Disabled
Optimize drives demand defragsvc Manual
Parental Controls demand WPCSvc Manual
Payments and NFC/SE Manager demand SEMgrSvc Manual
Peer Name Resolution Protocol demand PNRPsvc Manual
Peer Networking Grouping demand p2psvc Manual
Peer Networking Identity Manager demand p2pimsvc Manual Running
Pen Service demand PenService Manual
Performance Counter DLL Host demand PerfHost Manual
Performance Logs & Alerts demand pla Manual
Phone Service demand PhoneSvc Manual
Plug and Play demand PlugPlay Manual Running
PnP-X IP Bus Enumerator demand IPBusEnum Manual
PNRP Machine Name Publication Service demand PNRPAutoReg Manual
Portable Device Enumerator Service demand WPDBusEnum Manual Running
Power auto Power Automatic Running
Problem Reports Control Panel Support demand wercplsupport Manual
Program Compatibility Assistant Service demand PcaSvc Manual Running
Print Spooler auto Spooler Automatic Running
Printer Extensions and Notifications demand PrintNotify Manual
PrintWorkflow demand PrintWorkflowUserSvc Manual
Problem Reports and Solutions Control Panel Support demand wercplsupport Manual
Program Compatibility Assistant Service demand PcaSvc Manual Running
Protected Storage demand ProtectedStorage Manual Running
Quality Windows Audio Video Experience demand QWAVE Manual
Radio Management Service demand RmSvc Manual
Recommended Troubleshooting Service demand TroubleshootingSvc Manual Running
Remote Access Auto Connection Manager demand RasAuto Manual
Remote Access Connection Manager demand RasMan Manual
Remote Desktop Configuration demand SessionEnv Manual
Remote Desktop Services demand TermService Manual
Remote Desktop Services UserMode Port Redirector demand UmRdpService Manual
Remote Procedure Call (RPC) auto RpcSs Automatic Running
Remote Procedure Call (RPC) Locator demand RpcLocator Manual
Remote Registry demand RemoteRegistry Manual
Retail Demo Service demand RetailDemo Manual
Routing and Remote Access disabled RemoteAccess Disabled
RPC Endpoint Mapper auto RpcEptMapper Automatic Running
Secondary Logon demand seclogon Manual
Secure Socket Tunneling Protocol Service demand SstpSvc Manual
Security Accounts Manager auto SamSs Automatic Running
Security Center delayed-auto wscsvc Automatic (Delayed start)
Sensor Data Service demand SensorDataService Manual
Sensor Monitoring Service demand SensrSvc Manual
Sensor Service demand SensorService Manual
Server auto LanmanServer Automatic Running
Shared PC Account Manager disabled shpamsvc Disabled
Shell Hardware Detection auto ShellHWDetection Automatic Running
Smart Card demand SCardSvr Manual
Smart Card Device Enumeration Service demand ScDeviceEnum Manual
Smart Card Removal Policy demand SCPolicySvc Manual
SNMP Trap demand SNMPTRAP Manual
Software Protection delayed-auto sppsvc Automatic (Delayed start)
Spatial Data Service demand SharedRealitySvc Manual
Spot Verifier demand svsvc Manual
SPP Notification Service demand sppuinotify Manual Running
SSDP Discovery demand SSDPSRV Manual Running
State Repository Service auto StateRepository Automatic Running
Still Image Acquisition Events demand WiaRpc Manual
Storage Service auto StorSvc Automatic Running
Storage Tiers Management demand TieringEngineService Manual
Superfetch demand SysMain Manual Running
Sync Host delayed-auto OneSyncSvc Automatic (Delayed start)
SysMain auto SysMain Automatic Running
System Event Notification Service auto SENS Automatic Running
System Events Broker auto SystemEventsBroker Automatic Running
System Guard Runtime Monitor Broker delayed-auto SgrmBroker Automatic (Delayed start)
Tablet PC Input Service demand TabletInputService Manual
Task Scheduler auto Schedule Automatic Running
TCP/IP NetBIOS Helper demand lmhosts Manual
Telephony demand TapiSrv Manual
Themes auto Themes Automatic Running
Time Broker demand TimeBrokerSvc Manual Running
Thread Ordering Server demand THREADORDER Manual
Touch Keyboard and Handwriting Panel Service demand TabletInputService Manual Running
TPM Base Services demand TBS Manual
Udk User Service demand UdkUserSvcd Manual
Update Orchestrator Service delayed-auto UsoSvc Automatic (Delayed start)
UPnP Device Host demand upnphost Manual
User Data Access demand UserDataSvc Manual
User Data Storage demand UnistoreSvc Manual
User Experience Virtualization Service disabled UevAgentService Disabled
User Manager auto UserManager Automatic Running
User Profile Service auto ProfSvc Automatic Running
Virtual Disk demand vds Manual
Volume Shadow Copy demand VSS Manual Running
Volumetric Audio Compositor Service demand VacSvc Manual
WalletService demand WalletService Manual
WarpJITSvc demand WarpJITSvc Manual
Web Account Manager demand TokenBroker Manual Running
WebClient demand WebClient Manual Running
Wi-Fi Direct Services Connection Manager Service demand WFDSConMgrSvc Manual
Windows Audio auto AudioSrv Automatic Running
Windows Audio Endpoint Builder auto AudioEndpointBuilder Automatic Running
Windows Backup auto SDRSVC Automatic Running
Windows Biometric Service demand WbioSrvc Manual Running
Windows Camera Frame Server demand FrameServer Manual
Windows CardSpace demand idsvc Manual
Windows Color System demand WcsPlugInService Manual
Windows Connect Now Config Registrar demand wcncsvc Manual
Windows Connection Manager auto Wcmsvc Automatic Running
Windows Defender delayed-auto WinDefend Automatic (Delayed start) Running
Windows Defender Advanced Threat Protection Service demand Sense Manual
Windows Defender Firewall auto mpssvc Automatic Running
Windows Driver Foundation User-mode Driver Framework auto wudfsvc Automatic Running
Windows Encryption Provider Host Service demand WEPHOSTSVC Manual
Windows Error Reporting Service demand WerSvc Manual
Windows Event Collector demand Wecsvc Manual
Windows Event Log auto EventLog Automatic Running
Windows Firewall auto MpsSvc Automatic Running
Windows Font Cache Service delayed-auto FontCache Automatic (Delayed start) Running
Windows Image Acquisition (WIA) demand StiSvc Manual
Windows Insider Service demand wisvc Manual
Windows Installer demand msiserver Manual
Windows License Manager Service demand LicenseManager Manual
Windows Management Instrumentation auto Winmgmt Automatic Running
Windows Management Service demand WManSvc Manual
Windows Media Center Receiver Service demand ehRecvr Manual
Windows Media Center Scheduler Service demand ehSched Manual
Windows Media Player Network Sharing Service demand WMPNetworkSvc Manual
Windows Mixed Reality OpenXR Service demand MixedRealityOpenXRSvc Manual
Windows Mobile Hotspot Service demand icssvc Manual
Windows Modules Installer demand TrustedInstaller Manual
Windows Perception Service demand spectrum Manual
Windows Perception Simulation Service demand perceptionsimulation Manual
Windows Presentation Foundation Font Cache 3.0.0.0 demand FontCache3.0.0.0 Manual
Windows Push Notifications System Service auto WpnService Automatic Running
Windows Push Notifications User Service auto WpnUserService Automatic Running
Windows PushToInstall Service demand PushToInstall Manual
Windows Remote Management (WS-Management) demand WinRM Manual
Windows Search delayed-auto WSearch Automatic (Delayed start) Running
Windows Security Service demand SecurityHealthService Manual Running
Windows Time demand W32Time Manual
Windows Update demand wuauserv Manual Running
Windows Update Medic Service demand WaaSMedicSvc Manual
WinHTTP Web Proxy Auto-Discovery Service demand WinHttpAutoProxySvc Manual
Wired AutoConfig demand dot3svc Manual
WLAN AutoConfig demand Wlansvc Manual
WMI Performance Adapter demand wmiApSrv Manual Running
Work Folders demand workfolderssvc Manual
Workstation auto LanmanWorkstation Automatic Running
WWAN AutoConfig demand WwanSvc Manual
Xbox Accessory Management Service demand XboxGipSvc Manual
Xbox Live Auth Manager demand XblAuthManager Manual
Xbox Live Game Save demand XblGameSave Manual
Xbox Live Networking Service demand XboxNetApiSvc Manual
I also have an Excel spreadsheet of this data, as well as the services that gave "Access denied" when using sc.exe to set the startup type. I figured it would be a good idea to use services.msc and manually check those services. This is why I did not hide the error messages in my script.
Note: I checked for admin privileges, but did not relaunch the script in an attempt to gain them.