'execute slmgr command which dumps to a text file Set wshShell = WScript.CreateObject ("WSCript.shell") wshshell.run "cmd /c cscript C:\Windows\System32\slmgr.vbs /dlv > activationstatus.txt", 6, True set wshshell = nothing Const ForReading = 1 'open dump file Dim objFSO, objFile Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("activationstatus.txt", ForReading) Do Until objFile.AtEndOfStream currentline = objFile.ReadLine 'Bad words to look for if instr(currentline ,"EVAL") or instr(currentline ,"expiration") or instr(currentline ,"INSERTSOMETHING ELSE HERE?") then strFound = "1" End If Loop objFile.Close If (strFound = "1") then WScript.Echo "Windows is unlicensed or in trial mode!!!" WScript.Quit(1) else WScript.Echo "Windows appears to be activated" WScript.Quit(0) End If