Constant pings, banners, and chimes can turn even the calmest work session into a notification battlefield. Windows’ Focus Assist and Quiet Hours are great tools for silencing distractions — but if you have to remember to turn them on manually, you’re missing the real magic.
With a little bit of automation using Task Scheduler, you can make Focus Assist turn on and off exactly when you need it — no clicks, no “oops I forgot,” and no lost concentration.
Why Automate Focus Assist & Quiet Hours?
- Predictable deep work — Silence notifications automatically during your prime productivity hours.
- Meeting-friendly mode — Automatically activate Focus Assist when you start certain apps (like Zoom or PowerPoint).
- Context-based peace — Turn it on only when your laptop is plugged in, or during specific time windows.
- Stress-free evenings — Have notifications fade away after a set hour so you can relax.
Step 1: Know Your Focus Assist Modes
Windows offers three main levels:
- Off — All notifications come through.
- Priority Only — Only apps and contacts you’ve allowed.
- Alarms Only — Nothing but alarms will disturb you.
In automation, you’ll often use either Priority Only or Alarms Only.
Step 2: Creating a Task Scheduler Rule
- Open Task Scheduler
PressWindows + R, typetaskschd.msc, and hit Enter. - Create a New Task
Go to Action > Create Task (not “Basic Task” — you’ll want full control). - Set the Trigger
- Time-based: Example — every weekday from 9 AM to 12 PM.
- Event-based: On workstation lock/unlock, app launch, or AC power connection.
- Condition-based: Only run when plugged in or idle.
- Add the Action
- Go to Actions > New > Start a program
- Program/script: CopyEdit
powershell.exe - Add arguments: pgsqlCopyEdit
(New-Object -ComObject Shell.Application).ToggleDesktop() ; Start-Sleep -Milliseconds 500 ; (Get-Service -Name 'ShellHWDetection').Status(Replace with your chosen PowerShell command for enabling Focus Assist; examples below.)
Step 3: PowerShell Commands for Focus Assist
Unfortunately, Focus Assist doesn’t have a direct command-line toggle in standard Windows APIs. But you can use registry edits or third-party utilities or powershell as below to set its mode.
For example (registry method):
- Enable Priority Only powershellCopyEdit
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings /v NOC_GLOBAL_SETTING_TOASTS_ENABLED /t REG_DWORD /d 0 /f - Disable Focus Assist powershellCopyEdit
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings /v NOC_GLOBAL_SETTING_TOASTS_ENABLED /t REG_DWORD /d 1 /f
(You’ll need to restart Windows Explorer or log off/on for changes to fully apply.)
Step 4: Example Automation Scenarios
- Work Mode
Trigger: 9 AM weekdays
Action: Focus Assist → Priority Only
Condition: Plugged in - Meeting Mode
Trigger: When Zoom.exe starts
Action: Focus Assist → Alarms Only - Evening Quiet Hours
Trigger: 8 PM daily
Action: Focus Assist → Priority Only
Step 5: Going Beyond Basics
- Combine with Do Not Disturb in Microsoft Teams using Graph API calls.
- Integrate with Bluetooth device connection (e.g., when your headset connects, Focus Assist turns on).
- Use IFTTT or Power Automate for cross-device sync (e.g., phone + PC quiet hours match).
PowerShell Scripts for Focus Assist
1. Enable Focus Assist (Turn On Do-Not-Disturb)
powershellCopyEditSet-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings" `
-Name "NOC_GLOBAL_SETTING_TOASTS_ENABLED" -Value 0 -Force
This disables toast notifications, effectively activating Focus Assist.
2. Disable Focus Assist (Turn Off Do-Not-Disturb)
powershellCopyEditSet-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings" `
-Name "NOC_GLOBAL_SETTING_TOASTS_ENABLED" -Value 1 -Force
3. Comprehensive Disable (Windows 10 & 11 – including Quiet Hours)
powershellCopyEdit# Disable Quiet Hours and Do Not Disturb
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\FocusAssist" `
-Name "QuietHoursActive" -Value 0 -Force
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\FocusAssist" `
-Name "QuietHoursEnabled" -Value 0 -Force
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings" `
-Name "NOC_GLOBAL_SETTING_DND" -Value 0 -Force
This script updates additional focus-related registry keys for consistent control across Windows versions.
How to Use These Scripts
- Save the script(s) in
.ps1files (e.g.,Enable-FocusAssist.ps1,Disable-FocusAssist.ps1). - Run them under the current user context — they modify
HKCUkeys, so they won’t affect other users unless run in their session. - Automate with Task Scheduler:
- Action:
powershell.exe - Arguments: arduinoCopyEdit
-ExecutionPolicy Bypass -File "C:\Path\To\Enable-FocusAssist.ps1"
- Action:
- You can also deploy them via login scripts or management tools like Intune or Group Policy Preferences.
Quick Reference Table
| Scenario | Registry Key & Value |
|---|---|
| Enable Focus Assist (DND) | NOC_GLOBAL_SETTING_TOASTS_ENABLED = 0 |
| Disable Focus Assist | NOC_GLOBAL_SETTING_TOASTS_ENABLED = 1 |
| Fully disable (incl. Quiet Hours) | QuietHoursActive = 0, QuietHoursEnabled = 0, NOC_GLOBAL_SETTING_DND = 0 |
The Payoff
With Task Scheduler and Focus Assist working in harmony, you’ll stop thinking about when to mute your notifications — and just enjoy the quiet. Your workflow becomes more predictable, your meetings less interrupted, and your evenings more peaceful.






