Skip to content

Instantly share code, notes, and snippets.

@tanaka-geek
Last active March 3, 2022 05:32
Show Gist options
  • Save tanaka-geek/a7785c41f65a5ba7957214730e3eb538 to your computer and use it in GitHub Desktop.
Save tanaka-geek/a7785c41f65a5ba7957214730e3eb538 to your computer and use it in GitHub Desktop.
Windows 7 Enterprise Activation : fixed the path that wmic can't be found
@echo off
cd /d %windir%\system32&cscript //nologo slmgr.vbs /upk >nul&cscript //nologo slmgr.vbs /cpky >nul&C:\Windows\System32\wbem\wmic os | findstr /I "enterprise" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk 33PXH-7Y6KF-2VJC9-XBBR8-HVTHH >nul&cscript //nologo slmgr.vbs /ipk YDRBP-3D83W-TY26F-D46B2-XCKRJ >nul&cscript //nologo slmgr.vbs /ipk C29WB-22CC8-VJ326-GHFJW-H9DH4 >nul) else (cscript //nologo slmgr.vbs /ipk FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4 >nul&cscript //nologo slmgr.vbs /ipk MRPKT-YTG23-K7D7T-X2JMM-QY7MG >nul&cscript //nologo slmgr.vbs /ipk W82YF-2Q76Y-63HXB-FGJG9-GF7QX >nul)
set i=1
:server
if %i%==1 set KMS_Sev=kms7.MSGuides.com
if %i%==2 set KMS_Sev=kms8.MSGuides.com
if %i%==3 set KMS_Sev=kms9.MSGuides.com
if %i%==4 goto unsupported
cscript //nologo slmgr.vbs /skms %KMS_Sev% >nul&echo.&echo.
cscript //nologo slmgr.vbs /ato | find /i "successfully" || (echo The connection to my KMS server failed! Trying to connect to another one... & echo Please wait... & echo. & echo. & set /a i+=1 & goto server)
explorer "http://MSGuides.com"&goto halt
:unsupported
echo =&echo.&echo Your version is not supported.&echo.
:halt
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment