November 20, 200520 yr Yes it's possible ...Batch to detect Windows license, OEM or VL for /f "skip=4 tokens=3" %%? in ('reg query HKLM\SYSTEM\Setup\Pid /v Pid') do set Pid=%%? set Pid=%Pid:~-3% if '%Pid%'=='270' echo WinXP VL version detected && WhatCommandYouWant if '%Pid%'=='OEM' echo WinXP OEM version detected && WhatOtherCommandYouWant exitCredits to Yzöwl for his batch's knowledge !Title edited as per request. --Zxian
November 20, 200520 yr at command prompt type "ver"(without quotes)thanksEDIT:hmm that doesnt display home pro or corp, thats stupid! lol Edited November 20, 200520 yr by eyeball
November 20, 200520 yr Author okay Dr.God, but it's limited for just Home & Pro, for Corporate edition, I don't have any idea ...
November 20, 200520 yr You should be able to get this information from the Win32_OperatingSystem class. http://msdn.microsoft.com/library/default....environment.asp Determining what type of media was used to install will require parsing Win32_OperatingSystem.SerialNumber. This document may help but its written for server versions http://support.microsoft.com/?kbid=889713
November 20, 200520 yr Author hmm programming a exe just for that is too complicated for me (I must reinstall my old visual studio 2003 provided by my school ^^ ... and take several time ...)I think there is a file/registry key/whatever differs from each channel (in fact is term from Microsoft to design 'version' Home,Pro, Corp) of Windows XP. Edited November 20, 200520 yr by sonic
November 20, 200520 yr Try this VBS script strComputer = "."Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")For Each objOperatingSystem in colOperatingSystems Msgbox objOperatingSystem.Caption & " " & objOperatingSystem.Version, 0 + 32,"Window Version"Next
November 20, 200520 yr Author okay gunsmokingman, but it's just for Pro or Home version ...I think there is no differences between corp/vlk and pro in windows, but I think there is registry key or files for activation differs with retail version ...Reading http://www.msfn.org/board/index.php?showtopic=61066, I will check the key [HKEY_LOCAL_MACHINE\SYSTEM\Setup\Pid] ...Thanks all.Goodbye.EDIT:My main command form my batch to check my windows xp version :for /f "skip=4 tokens=3" %%i in ('reg query HKLM\SYSTEM\Setup\Pid /v Pid') do set Pid=%%i Edited November 20, 200520 yr by sonic
November 20, 200520 yr Author Where you see if windows xp is pro or corporate ?? To detect Home or Pro version no problem ...
November 21, 200520 yr Author @Yahoo : not for corporate version ... there isn't differences between oem and corporate/vlk in windows itself ... we must check pid (or other regkey/files) or develop an exe in .net/c using microsoft api ...
January 9, 200620 yr Author Improved batch to detect Corporate version of Windowsfor /f "skip=4 tokens=3" %%? in ('reg query HKLM\SYSTEM\Setup\Pid /v Pid') do set Pid=%%?set Pid=%Pid:~-3%if '%Pid%'=='270' echo Corporate version detected && WhatCommandYouWantif not '%Pid%'=='OEM' echo OEM version detected && WhatOtherCommandYouWantexitCredits to Yzöwl for his batch's knowledge ! Edited January 9, 200620 yr by sonic
January 10, 200620 yr Look at your product ID in the System Property sheet.First set:55274 : XP Professional55276 : XP Professional upgrade55276 : XP Home55277 : XP Home55285 : XP Professional76487 : XP Media Center Edition 200576487 : XP Pro Royalty OEM76487 : XP Pro volume license (with '640' channel ID)Second set:007 : retail011 : upgradeOEM : OEM270 : Volume License335 : Retail640 : Volume License648 : Academic
Create an account or sign in to comment