echo off for tokens delims in wmic path SoftwareLicensingPro duct wher

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
@echo off
for /f "tokens=2 delims==" %%G in (
'wmic path SoftwareLicensingProduct where "PartialProductKey is not null" get ID /value'
) do (set ActID=%%G & call:check)
pause >nul & exit
:check
set verb=0
if %verb%==0 set verb=1
cscript //nologo %SystemRoot%\system32\slmgr.vbs /dli %ActID%
exit /b