summaryrefslogtreecommitdiff
path: root/MAS/Separate-Files-Version/Check-Activation-Status.cmd
diff options
context:
space:
mode:
authorWindowsAddict2024-08-17 23:38:35 +0000
committerWindowsAddict2024-08-17 23:38:35 +0000
commitd55b9fa78c301672774a1fb4be13d55935871762 (patch)
treefde82bce20e8a9bc6bb5dcdfd546ac3fab478d81 /MAS/Separate-Files-Version/Check-Activation-Status.cmd
parentfb113c7c243190b267722d4a5fca48bc0a7a40e4 (diff)
downloadMicrosoft-Activation-Scripts-d55b9fa78c301672774a1fb4be13d55935871762.zip
Avoid using pause if Terminal is detected
Diffstat (limited to 'MAS/Separate-Files-Version/Check-Activation-Status.cmd')
-rw-r--r--MAS/Separate-Files-Version/Check-Activation-Status.cmd17
1 files changed, 15 insertions, 2 deletions
diff --git a/MAS/Separate-Files-Version/Check-Activation-Status.cmd b/MAS/Separate-Files-Version/Check-Activation-Status.cmd
index 02bedad..a9ba6a4 100644
--- a/MAS/Separate-Files-Version/Check-Activation-Status.cmd
+++ b/MAS/Separate-Files-Version/Check-Activation-Status.cmd
@@ -6,10 +6,23 @@
:: https://gravesoft.dev/cas
+:: Set Environment variables, it helps if they are misconfigured in the system
+
+setlocal EnableExtensions
+setlocal DisableDelayedExpansion
+
+set "PathExt=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
+
+set "SysPath=%SystemRoot%\System32"
set "Path=%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
if exist "%SystemRoot%\Sysnative\reg.exe" (
+set "SysPath=%SystemRoot%\Sysnative"
set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%Path%"
)
+
+set "ComSpec=%SysPath%\cmd.exe"
+set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules"
+
set "_psc=powershell -nop -c"
set "_err===== ERROR ===="
set _pwsh=1
@@ -29,8 +42,8 @@ setlocal EnableDelayedExpansion
:E_Exit
echo.
-echo Press any key to exit.
-pause >nul
+echo Press 0 key to exit.
+choice /c 0 /n
exit /b
:sppmgr: