Check Windows license activation

Version: 1.7.12
Creator Name: Marcel Calef
Date Created: 2020-05-11
Date Modified: 2020-06-01
Scripting language: BAT
Download Count: 14

Check the windows licenses activation using the slmgr.vbs script and parse significant info Verbose=No will read the Status line and include the Notification if not properly licensed
Tags: license, activation

The Script

@ECHO OFF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::  Synopsis:  Windows license activation check
::  Details:   Check the windows licenses activation using the slmgr.vbs script and parse significant info
::             Verbose=No will read the Status line and include the Notification if not properly licensed
::  Credit:    https://superuser.com/users/942348/zer0byt3 for how to display in the output instead of a popup
::                                    invoke slmgr using: cscript //nologo
::             https://stackoverflow.com/questions/31035636/batch-store-command-output-to-a-variable-multiple-lines
::  Context:   Machine
::  Tags:      $OperatingSystem="*Windows*"
::	History:   2020-06-01 Marcel Calef - initial release
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

SET OpSYS=%1   
SET OSVer=%2 
SET verboseLevel=%3

if "%verboseLevel%"=="Yes" (
	ECHO %OpSYS%
	ECHO %OSVer%
	ECHO.
	ECHO ======================================================================
	cscript //nologo c:\windows\System32\slmgr.vbs /dlv | findstr /C:"Name:" /C:"Key Channel:" /C:"Product Key:" /C:"Status" /C:"Licensed" /C:"Notification"
	)
	
if "%verboseLevel%"=="No"  (
	:: Read the Status line and include the Notification if not properly licensed
	cscript //nologo c:\windows\System32\slmgr.vbs /dlv | findstr /C:"Licensed" /C:"Notification"
	)