mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2024-11-23 23:11:15 +00:00
Compare commits
3 commits
a62c3ac36d
...
d55b9fa78c
Author | SHA1 | Date | |
---|---|---|---|
d55b9fa78c | |||
fb113c7c24 | |||
9efc3e49b9 |
|
@ -1458,7 +1458,13 @@ for %%# in (
|
|||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
|
||||
%psc% "$acl = (Get-Acl '%%A' | fl | Out-String); if (-not ($acl -match 'NT SERVICE\\sppsvc Allow %%B') -or ($acl -match 'NT SERVICE\\sppsvc Deny')) {Exit 2}" %nul%
|
||||
if !errorlevel!==2 set permerror=Error_Found
|
||||
if !errorlevel!==2 (
|
||||
if "%%A"=="%tokenstore%" (
|
||||
set "permerror=Error Found In Token Folder"
|
||||
) else (
|
||||
set "permerror=Error Found In SPP Registries"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||
|
|
|
@ -1601,7 +1601,13 @@ for %%# in (
|
|||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
|
||||
%psc% "$acl = (Get-Acl '%%A' | fl | Out-String); if (-not ($acl -match 'NT SERVICE\\sppsvc Allow %%B') -or ($acl -match 'NT SERVICE\\sppsvc Deny')) {Exit 2}" %nul%
|
||||
if !errorlevel!==2 set permerror=Error_Found
|
||||
if !errorlevel!==2 (
|
||||
if "%%A"=="%tokenstore%" (
|
||||
set "permerror=Error Found In Token Folder"
|
||||
) else (
|
||||
set "permerror=Error Found In SPP Registries"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||
|
|
|
@ -1908,7 +1908,13 @@ for %%# in (
|
|||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
|
||||
%psc% "$acl = (Get-Acl '%%A' | fl | Out-String); if (-not ($acl -match 'NT SERVICE\\sppsvc Allow %%B') -or ($acl -match 'NT SERVICE\\sppsvc Deny')) {Exit 2}" %nul%
|
||||
if !errorlevel!==2 set permerror=Error_Found
|
||||
if !errorlevel!==2 (
|
||||
if "%%A"=="%tokenstore%" (
|
||||
set "permerror=Error Found In Token Folder"
|
||||
) else (
|
||||
set "permerror=Error Found In SPP Registries"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||
|
|
|
@ -2957,7 +2957,13 @@ for %%# in (
|
|||
"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform+SetValue"
|
||||
) do for /f "tokens=1,2 delims=+" %%A in (%%#) do if not defined permerror (
|
||||
%psc% "$acl = (Get-Acl '%%A' | fl | Out-String); if (-not ($acl -match 'NT SERVICE\\sppsvc Allow %%B') -or ($acl -match 'NT SERVICE\\sppsvc Deny')) {Exit 2}" %nul%
|
||||
if !errorlevel!==2 set permerror=Error_Found
|
||||
if !errorlevel!==2 (
|
||||
if "%%A"=="%tokenstore%" (
|
||||
set "permerror=Error Found In Token Folder"
|
||||
) else (
|
||||
set "permerror=Error Found In SPP Registries"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
REM https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -829,10 +829,14 @@ echo:
|
|||
) else (
|
||||
echo:
|
||||
call :dk_color %_Yellow% "A Window will popup, in that Window you need to select [Quick] Repair Option..."
|
||||
if defined terminal (
|
||||
call :dk_color %_Yellow% "Press 0 key to continue..."
|
||||
choice /c 0 /n
|
||||
) else (
|
||||
call :dk_color %_Yellow% "Press any key to continue..."
|
||||
echo:
|
||||
pause %nul1%
|
||||
)
|
||||
)
|
||||
|
||||
if defined uwp16 (
|
||||
echo:
|
||||
|
@ -892,12 +896,6 @@ echo WMI rebuild is not recommended on Windows Server. Aborting...
|
|||
goto :at_back
|
||||
)
|
||||
|
||||
for %%# in (wmic.exe) do @if "%%~$PATH:#"=="" (
|
||||
%eline%
|
||||
echo wmic.exe file is not found in the system. Aborting...
|
||||
goto :at_back
|
||||
)
|
||||
|
||||
echo:
|
||||
echo Checking WMI
|
||||
call :checkwmi
|
||||
|
@ -1030,12 +1028,12 @@ exit /b
|
|||
:: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-error-constants
|
||||
|
||||
set error=
|
||||
wmic path Win32_ComputerSystem get CreationClassName /value %nul2% | find /i "computersystem" %nul1%
|
||||
%psc% "Get-WmiObject -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" %nul2% | find /i "computersystem" %nul1%
|
||||
if %errorlevel% NEQ 0 (set error=1& exit /b)
|
||||
winmgmt /verifyrepository %nul%
|
||||
if %errorlevel% NEQ 0 (set error=1& exit /b)
|
||||
|
||||
cscript //nologo %windir%\system32\slmgr.vbs /dlv %nul%
|
||||
%psc% "try { $null=([WMISEARCHER]'SELECT * FROM SoftwareLicensingService').Get().Version; exit 0 } catch { exit $_.Exception.InnerException.HResult }" %nul%
|
||||
cmd /c exit /b %errorlevel%
|
||||
echo "0x%=ExitCode%" | findstr /i "0x800410 0x800440" %nul1%
|
||||
if %errorlevel% EQU 0 set error=1
|
||||
|
@ -1048,8 +1046,13 @@ exit /b
|
|||
echo:
|
||||
echo %line%
|
||||
echo:
|
||||
call :dk_color %_Yellow% "Press any key to go back..."
|
||||
if defined terminal (
|
||||
call :dk_color %_Yellow% "Press 0 key to %_exitmsg%..."
|
||||
choice /c 0 /n
|
||||
) else (
|
||||
call :dk_color %_Yellow% "Press any key to %_exitmsg%..."
|
||||
pause %nul1%
|
||||
)
|
||||
goto :at_menu
|
||||
|
||||
::========================================================================================================================================
|
||||
|
|
Loading…
Reference in a new issue