Skip to content

Instantly share code, notes, and snippets.

@InvisibleRain
Created May 27, 2023 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save InvisibleRain/1acd50570863a5c69bdc2251aa9fb753 to your computer and use it in GitHub Desktop.
Save InvisibleRain/1acd50570863a5c69bdc2251aa9fb753 to your computer and use it in GitHub Desktop.
@echo off
goto check_Permissions
:check_Permissions
echo Administrative permissions required. Detecting permissions...
net session >nul 2>&1
if %errorLevel% == 0 (
echo Success: Administrative permissions confirmed.
) else (
echo Failure: Current permissions inadequate. Run as administrator.
pause >nul
)
w32tm /config /syncfromflags:manual /manualpeerlist:0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org,3.pool.ntp.org
w32tm /resync
exit /b 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment