%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. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
if%_wmic%EQU 1 set"chkedi=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL) get LicenseFamily /VALUE"%nul6%')"
if%_wmic%EQU 0 set"chkedi=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT LicenseFamily FROM %spp% WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL').Get()).LicenseFamily ^|%% {echo ('LicenseFamily='+$_)}"%nul6%')"
%chkedi% do if not errorlevel 1 (call set "osedition=%%a")
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
ifexist"%SysPath%\wlms\wlms.exe"(
ifexist"%SysPath%\wlms\wlms.exe"(
if%winbuild%LSS 9200(
sc query wlms | find /i "RUNNING"%nul%&&(
echo Checking Eval WLMS Service [Found]
echo Checking Eval WLMS Service [Found]
) else (
call:dk_color%Red%"Checking Eval WLMS Service [Found]"
%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. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
if%_wmic%EQU 1 set"chkedi=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL) get LicenseFamily /VALUE"%nul6%')"
if%_wmic%EQU 0 set"chkedi=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT LicenseFamily FROM %spp% WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL').Get()).LicenseFamily ^|%% {echo ('LicenseFamily='+$_)}"%nul6%')"
%chkedi% do if not errorlevel 1 (call set "osedition=%%a")
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
ifexist"%SysPath%\wlms\wlms.exe"(
ifexist"%SysPath%\wlms\wlms.exe"(
if%winbuild%LSS 9200(
sc query wlms | find /i "RUNNING"%nul%&&(
echo Checking Eval WLMS Service [Found]
echo Checking Eval WLMS Service [Found]
) else (
call:dk_color%Red%"Checking Eval WLMS Service [Found]"
if%_wmic%EQU 1 set"chkapp=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='%1') get ID /VALUE"%nul6%')"
if%_wmic%EQU 1 set"chkapp=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='%1') get ID /VALUE"%nul6%')"
if%_wmic%EQU 0 set"chkapp=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT ID FROM %spp% WHERE ApplicationID=''%1''').Get()).ID ^|%% {echo ('ID='+$_)}"%nul6%')"
if%_wmic%EQU 0 set"chkapp=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT ID FROM %spp% WHERE ApplicationID=''%1''').Get()).ID ^|%% {echo ('ID='+$_)}"%nul6%')"
%chkapp% do (if defined allapps (call set "allapps=!allapps! %%a") else (call set "allapps=%%a"))
%chkapp% do (if defined allapps (call set "allapps=!allapps! %%a") else (call set "allapps=%%a"))
:: Check potential script crash issue when user manually installs way too many licenses for Office (length limit in variable)
%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. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
if%_wmic%EQU 1 set"chkedi=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL) get LicenseFamily /VALUE"%nul6%')"
if%_wmic%EQU 0 set"chkedi=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT LicenseFamily FROM %spp% WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL').Get()).LicenseFamily ^|%% {echo ('LicenseFamily='+$_)}"%nul6%')"
%chkedi% do if not errorlevel 1 (call set "osedition=%%a")
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
ifexist"%SysPath%\wlms\wlms.exe"(
ifexist"%SysPath%\wlms\wlms.exe"(
if%winbuild%LSS 9200(
sc query wlms | find /i "RUNNING"%nul%&&(
echo Checking Eval WLMS Service [Found]
echo Checking Eval WLMS Service [Found]
) else (
call:dk_color%Red%"Checking Eval WLMS Service [Found]"
if%_wmic%EQU 1 set"chkapp=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='%1') get ID /VALUE"%nul6%')"
if%_wmic%EQU 1 set"chkapp=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='%1') get ID /VALUE"%nul6%')"
if%_wmic%EQU 0 set"chkapp=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT ID FROM %spp% WHERE ApplicationID=''%1''').Get()).ID ^|%% {echo ('ID='+$_)}"%nul6%')"
if%_wmic%EQU 0 set"chkapp=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT ID FROM %spp% WHERE ApplicationID=''%1''').Get()).ID ^|%% {echo ('ID='+$_)}"%nul6%')"
%chkapp% do (if defined allapps (call set "allapps=!allapps! %%a") else (call set "allapps=%%a"))
%chkapp% do (if defined allapps (call set "allapps=!allapps! %%a") else (call set "allapps=%%a"))
:: Check potential script crash issue when user manually installs way too many licenses for Office (length limit in variable)
%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. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
:: Get Product name (WMI/REG methods are not reliable in all conditions, hence winbrand.dll method is used)
if%_wmic%EQU 1 set"chkedi=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL) get LicenseFamily /VALUE"%nul6%')"
if%_wmic%EQU 0 set"chkedi=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT LicenseFamily FROM %spp% WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL').Get()).LicenseFamily ^|%% {echo ('LicenseFamily='+$_)}"%nul6%')"
%chkedi% do if not errorlevel 1 (call set "osedition=%%a")
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
:: This "WLMS" service was included in previous Eval editions (which were activable) to automatically shut down the system every hour after the evaluation period expired and prevent SPPSVC from stopping.
ifexist"%SysPath%\wlms\wlms.exe"(
ifexist"%SysPath%\wlms\wlms.exe"(
if%winbuild%LSS 9200(
sc query wlms | find /i "RUNNING"%nul%&&(
echo Checking Eval WLMS Service [Found]
echo Checking Eval WLMS Service [Found]
) else (
call:dk_color%Red%"Checking Eval WLMS Service [Found]"
%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. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Common lines used in PowerShell reflection code
:: Common lines used in PowerShell reflection code
@ -1420,11 +1320,7 @@ echo:
if%_unattended%==1 timeout /t 2 &exit /b
if%_unattended%==1 timeout /t 2 &exit /b
ifdefinedfixes(
ifdefinedfixes(
call:dk_color%White%""
call:dk_color2%Blue%"Press [1] To Open Troubleshoot Page "%Gray%" Press [0] To Ignore"
call:dk_color%White%"Follow ALL the ABOVE blue lines. "
call:dk_color%White%""
echo:
call:dk_color2%Blue%"Press [1] to Open Support Webpage "%Gray%" Press [0] to Ignore"
if%_wmic%EQU 1 set"chkedi=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL) get LicenseFamily /VALUE"%nul6%')"
if%_wmic%EQU 1 set"chkedi=for /f "tokens=2 delims=="%%a in ('"wmic path %spp% where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL) get LicenseFamily /VALUE"%nul6%')"
if%_wmic%EQU 0 set"chkedi=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT LicenseFamily FROM %spp% WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL').Get()).LicenseFamily ^|%% {echo ('LicenseFamily='+$_)}"%nul6%')"
if%_wmic%EQU 0 set"chkedi=for /f "tokens=2 delims=="%%a in ('%psc%"(([WMISEARCHER]'SELECT LicenseFamily FROM %spp% WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f'' AND LicenseDependsOn is NULL AND PartialProductKey IS NOT NULL').Get()).LicenseFamily ^|%% {echo ('LicenseFamily='+$_)}"%nul6%')"
ifnotdefinedosedition%chkedi% do if not errorlevel 1 (call set "osedition=%%a")
%chkedi% do if not errorlevel 1 (call set "osedition=%%a")
%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. Help - %mas%troubleshoot'}"
%psc%"$job = Start-Job { (Get-WmiObject -Query 'SELECT * FROM %sps%').Version }; if (-not (Wait-Job $job -Timeout 20)) {write-host 'sppsvc is not working correctly. Help - %mas%troubleshoot'}"
exit /b
exit /b
:: Common lines used in PowerShell reflection code
:: Common lines used in PowerShell reflection code
@ -996,11 +987,7 @@ echo:
if%_unattended%==1 timeout /t 2 &exit /b
if%_unattended%==1 timeout /t 2 &exit /b
ifdefinedfixes(
ifdefinedfixes(
call:dk_color%White%""
call:dk_color2%Blue%"Press [1] to Open Troubleshoot Page "%Gray%" Press [0] to Ignore"
call:dk_color%White%"Follow ALL the ABOVE blue lines. "
call:dk_color%White%""
echo:
call:dk_color2%Blue%"Press [1] to Open Support Webpage "%Gray%" Press [0] to Ignore"
:: For Windows 10/11 editions, HWID key is listed where ever possible, in Server versions, KMS key is listed where ever possible.
:: For Windows 10/11 editions, HWID key is listed where ever possible, in Server versions, KMS key is listed where ever possible.
:: For Windows, generic keys are mentioned till 22000 and for Server, generic keys are mentioned till 17763, later ones are extracted from the pkeyhelper.dll
:: Only RS3 and older version Generic keys are stored here, later ones are extracted from the pkeyhelper.dll itself
<palign="center">Open-source Windows and Office activator featuring HWID, Ohook, KMS38, and Online KMS activation methods, along with advanced troubleshooting.</p>
<palign="center">A Windows and Office activator using HWID / Ohook / KMS38 / Online KMS activation methods, with a focus on open-source code and fewer antivirus detections.</p>
<palign="center">
<ahref="https://discord.gg/tVFN4N84PP"><imgsrc="https://img.shields.io/badge/Chat%20with%20us%20on%20Discord--blue?style=social&logo=discord"alt="Chat with us without signup"title="Chat with us without signup"></a>
<ahref="https://www.reddit.com/r/MAS_Activator"><imgsrc="https://img.shields.io/badge/MAS%20on%20Reddit--orange?style=social&logo=reddit"alt="MAS on Reddit"title="MAS on Reddit"></a>
<ahref="https://twitter.com/massgravel"><imgsrc="https://img.shields.io/twitter/follow/massgravel"alt="Follow us on X"title="Follow us on X"></a>
</p>
<hr>
<hr>
@ -15,76 +21,42 @@
```
```
irm https://get.activated.win | iex
irm https://get.activated.win | iex
```
```
3. You will see the activation options. Choose (1) HWID for Windows activation. Choose (2) Ohook for Office activation.
or (deprecated, will be retired on Dec 31 2024, use above instead)
4. That's all.
<details>
<summary>More options</summary>
- Alternatively, you can use the following (It will be deprecated in the future.)
```
```
irm https://massgrave.dev/get | iex
irm https://massgrave.dev/get | iex
```
```
- The URL `get.activated.win` might be blocked by some DNS services because it is a new domain.
3. You will see the activation options. Choose [1] HWID for Windows activation. Choose [2] Ohook for Office activation.
4. That's all.
</details>
---
---
### Method 2 - Traditional (Windows 7 and later)
- On older Windows builds you may need to run the below command before,
- The Powershell method does not work on Windows 7. Use the Method 2 - Traditional instead.
- The URL get.activated.win may be blocked by some DNS services because it is a new domain.
<details>
### Method 2 - Traditional (Windows 7 and later)
<summary>Click here for info</summary>
1. Download the file under the code button from [GitHub](https://github.com/massgravel/Microsoft-Activation-Scripts) or [Azure DevOps](https://dev.azure.com/massgrave/_git/Microsoft-Activation-Scripts) or [Self-hosted Git](https://git.activated.win/massgrave/Microsoft-Activation-Scripts)
1. Download the file under the code button from [GitHub](https://github.com/massgravel/Microsoft-Activation-Scripts) / [Azure DevOps](https://dev.azure.com/massgrave/_git/Microsoft-Activation-Scripts) / [Self-hosted Git](https://git.activated.win/massgrave/Microsoft-Activation-Scripts)
2. Right-click on the downloaded zip file and extract
2. Right-click on the downloaded zip file and extract
3. In the extracted folder, find the folder named `All-In-One-Version`
3. In the extracted folder, find the folder named `All-In-One-Version`
4. Run the file named `MAS_AIO.cmd`
4. Run the file named `MAS_AIO.cmd`
5. You will see the activation options, follow the on-screen instructions.
5. You will see the activation options, follow the on-screen instructions.
6. That's all.
6. That's all.
</details>
To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches)
---
> [!NOTE]
>
> - The IRM command in PowerShell downloads a script from a specified URL, and the IEX command executes it.
> - Always double-check the URL before executing the command and verify the source if manually downloading files.
> - Be cautious, as some spread malware disguised as MAS by using different URLs in the IRM command.
---
</br>
To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches).