Windows Registry, Services & Task Scheduler
Your practical cockpit for Windows under the hood: query and back up Registry hives safely, control background Services from CLI, automate jobs with Task Scheduler, and troubleshoot boot settings with bcdedit.
0 Anatomy of a Registry Path
The Windows Registry is a hierarchical database (like folders and files) that stores OS, hardware, and app settings. Every entry has four parts:
HKLM\SYSTEM\CurrentControlSet\Services\Spooler โ Start = 2 (REG_DWORD)
01 The 5 Root Hives & Registry CLI
All Windows Registry keys live inside five top-level root hives. Knowing which hive holds machine-wide vs. per-user settings saves hours of troubleshooting.
| Short | Full Hive Name | What It Stores | Real-World Example |
|---|---|---|---|
HKLM |
HKEY_LOCAL_MACHINE |
System-wide hardware, OS, drivers, and Windows Services (affects all users). | HKLM\SYSTEM\CurrentControlSet\Services |
HKCU |
HKEY_CURRENT_USER |
Settings for the currently logged-in user (desktop, Run apps, theme). | HKCU\Software\Microsoft\Windows\CurrentVersion\Run |
HKCR |
HKEY_CLASSES_ROOT |
File extensions (.pdf, .txt) and COM object associations. Merged view of HKLM + HKCU. |
HKCR\.txt |
HKU |
HKEY_USERS |
All loaded user profiles on the PC, mapped by Security Identifier (SID). HKCU is a link into HKU. |
HKU\.DEFAULT (login screen prefs) |
HKCC |
HKEY_CURRENT_CONFIG |
Active hardware profile used at boot (shortcut to HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\Current). |
Display & hardware profile state |
Essential Registry Commands (CMD & PowerShell)
reg query
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Run"reg export
reg import to restore.reg export "HKLM\SOFTWARE\MyApp" C:\backup\myapp.reg /yreg add
/v = value name, /t = data type (REG_SZ, REG_DWORD), /d = data, /f = overwrite without prompt.reg add "HKCU\Software\MyApp" /v Enabled /t REG_DWORD /d 1 /fGet-ItemProperty
HKLM:\, HKCU:\) so you can filter properties cleanly.Get-ItemProperty "HKLM:\...\CurrentVersion" | Select ProductName02 Windows Services CLI
Services are background programs that run without a window โ even before you log in. Many built-in services are DLLs hosted inside shared svchost.exe processes to save memory.
Get-Service
Get-Service -Name Spooler, wuauservStart-Service
Stop-Service to halt it.Start-Service -Name SpoolerRestart-Service
-Force if dependent services must also restart.Restart-Service -Name Spooler -Forcesc query
WIN32_EXIT_CODE when a service fails to start.sc query Spooler or sc qc Spooler (view binary path)sc config
start=! Options: auto, delayed-auto, demand (manual), disabled.sc config Spooler start= auto (or PS: Set-Service Spooler -StartupType Automatic)tasklist /svc
svchost.exe PID to the exact Windows services hosted inside it โ essential for CPU/RAM spikes.tasklist /svc /fi "imagename eq svchost.exe"03 Task Scheduler CLI
Task Scheduler runs scripts, backups, and maintenance jobs automatically based on time, logon, or system events. Use schtasks in CMD or *-ScheduledTask in PowerShell.
schtasks /query
/v for verbose details (script path & user).schtasks /query /tn "\BackupJob" /v /fo LISTschtasks /create
/tn = task name, /tr = program/script, /sc = schedule (DAILY, ONLOGON, HOURLY), /st = start time.schtasks /create /tn "DailyCleanup" /tr "C:\scripts\clean.bat" /sc DAILY /st 02:00schtasks /run
schtasks /run /tn "DailyCleanup" (use /end to stop)Register-ScheduledTask
schtasks for complex triggers and PowerShell scripts. Pair with Get-ScheduledTask.Get-ScheduledTask -TaskName "PSBackup" | Start-ScheduledTask04 Startup, msconfig, Safe Mode & bcdedit
When Windows fails to boot or slows down at login, these tools control what loads at startup and how the Windows Boot Manager (BCD) behaves.
Quick GUI Consoles (Win+R)
- Registry Editorregedit
- Services Consoleservices.msc
- Task Schedulertaskschd.msc
- System Configuration (Boot/Startup)msconfig
- Startup Apps Foldershell:startup
Boot & Safe Mode CLI
- View Boot Entries
bcdedit /enum - Enable Safe Mode (Next Boot)
bcdedit /set {current} safeboot minimal - Safe Mode + Networking
bcdedit /set {current} safeboot network - Return to Normal Boot
bcdedit /deletevalue {current} safeboot - List Startup Programs
wmic startup get caption,command
sc config, always remember the space after the equals sign: start= auto (never start=auto)!
05 Danger Zone โ Avoid Breaking Windows
Registry, Services, and Boot Configuration changes take effect immediately โ there is no "Undo" button in the CLI.
HKLM keys without a reg export backupreg delete ... /f on system keys can prevent Windows from booting. Always run reg export <key> backup.reg first so you can restore from WinRE if needed.RpcSs, PlugPlay, DcomLaunch)RpcSs) and Plug and Play (PlugPlay) are dependencies for almost all Windows subsystems. Disabling them can lock you out of Device Manager, networking, and Services itself.bcdedit /set {current} safeboot or deleting {current}safeboot persists across reboots until you run bcdedit /deletevalue {current} safeboot. Never run bcdedit /delete {current} โ that removes your OS boot entry.