summaryrefslogtreecommitdiff
path: root/MAS/Separate-Files-Version/Change_Windows_Edition.cmd
diff options
context:
space:
mode:
authorWindowsAddict <[email protected]>2025-04-20 19:35:53 +0530
committerWindowsAddict <[email protected]>2025-04-20 19:35:53 +0530
commit98ef9db3ceffd5fdb49e3a4433be4a76a9a986ca (patch)
tree787ffa3aa2568c7ddcab7540072cf7de9ed23e18 /MAS/Separate-Files-Version/Change_Windows_Edition.cmd
parent172fd7b1c521e84d721653e4c57bec2e321493ad (diff)
downloadMicrosoft-Activation-Scripts-98ef9db3ceffd5fdb49e3a4433be4a76a9a986ca.zip
Add TSforge and Online KMS support for Vista/Server2008
Diffstat (limited to 'MAS/Separate-Files-Version/Change_Windows_Edition.cmd')
-rw-r--r--MAS/Separate-Files-Version/Change_Windows_Edition.cmd26
1 files changed, 18 insertions, 8 deletions
diff --git a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd
index 594f857..eff01d7 100644
--- a/MAS/Separate-Files-Version/Change_Windows_Edition.cmd
+++ b/MAS/Separate-Files-Version/Change_Windows_Edition.cmd
@@ -139,9 +139,9 @@ goto dk_done
)
if %winbuild% LSS 7600 (
-%nceline%
+%eline%
echo Unsupported OS version detected [%winbuild%].
-echo Project is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
+echo This option is supported only for Windows 7/8/8.1/10/11 and their Server equivalents.
goto dk_done
)
@@ -824,10 +824,16 @@ exit /b
:dk_setvar
-set psc=powershell.exe -nop -c
+set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe
+set psc=%ps% -nop -c
set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
+set _slexe=sppsvc.exe& set _slser=sppsvc
+if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc)
+if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc)
+if %_slexe%==SLsvc.exe set _vis=1
+
set _NCS=1
if %winbuild% LSS 10586 set _NCS=0
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
@@ -911,16 +917,16 @@ exit /b
:dk_sppissue
-sc start sppsvc %nul%
+sc start %_slser% %nul%
set spperror=%errorlevel%
if %spperror% NEQ 1056 if %spperror% NEQ 0 (
%eline%
-echo sc start sppsvc [Error Code: %spperror%]
+echo sc start %_slser% [Error Code: %spperror%]
)
echo:
-%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host 'sppsvc is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
+%psc% "$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 30)) {write-host '%_slser% is not working correctly. Check this webpage for help - %mas%troubleshoot'}"
exit /b
:: Common lines used in PowerShell reflection code
@@ -1018,8 +1024,10 @@ exit /b
if %_NCS% EQU 1 (
echo %esc%[%~1%~2%esc%[0m
-) else (
+) else if exist %ps% (
%psc% write-host -back '%1' -fore '%2' '%3'
+) else if not exist %ps% (
+echo %~3
)
exit /b
@@ -1027,8 +1035,10 @@ exit /b
if %_NCS% EQU 1 (
echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m
-) else (
+) else if exist %ps% (
%psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6'
+) else if not exist %ps% (
+echo %~3 %~6
)
exit /b