Skip to content

Instantly share code, notes, and snippets.

@st1vms
Last active July 26, 2025 12:26
Show Gist options
  • Save st1vms/daba2508aeccd7dfb607ce1abd65fc55 to your computer and use it in GitHub Desktop.
Save st1vms/daba2508aeccd7dfb607ce1abd65fc55 to your computer and use it in GitHub Desktop.
Flush DNS Cache on Boot (Windows)
Flush DNS Cache on Boot (Windows)
@echo off
set "pwshPath=C:\Program Files\PowerShell\7\pwsh.exe"
schtasks /create ^
/tn "ipconfig-flushdns-on-boot" ^
/tr "\"%pwshPath%\" -Command \"C:\Windows\System32\ipconfig.exe /flushdns\"" ^
/sc onstart ^
/RL highest ^
/ru SYSTEM
@pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment