From a661308e4592994066d0780527c57dfe94e4d456 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 23 Jul 2019 14:00:58 +0100 Subject: Add permission check --- 0-win10prep.bat | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to '0-win10prep.bat') diff --git a/0-win10prep.bat b/0-win10prep.bat index ef9997f..7f50471 100644 --- a/0-win10prep.bat +++ b/0-win10prep.bat @@ -9,10 +9,19 @@ echo. echo Please review and be aware of what this script does before running it. echo There is no uninstaller, and backups won't be created. echo. -echo You won't be prompted any further. -echo Press [enter] to begin. -echo. -set /p= +rem check permissions +net session >nul 2>&1 +if %errorLevel% == 0 ( + echo You won't be prompted any further. + echo Press [enter] to begin. + echo. + set /p= +) else ( + echo This script requires administrator rights. + echo Press any key to exit + pause >nul + exit +) rem Process