[.vbs] Windows XP Media Center Edition detect version Hi If you have got Windows XP Media Center Edition please can you test the script below Thanks Code: ' ' WinNT: XP Media Center Edition / Windows Media Center ' Created By 38956 ' 21100819.4 Alpha 1026 Dim objFSO Dim shell, envProcess set shell = createobject("wscript.shell") set envProcess = shell.Environment("process") windir = envProcess("windir") Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FileExists(windir & "\ehome\ehshell.exe") Then MCEver = objFSO.GetFileVersion(windir & "\ehome\ehshell.exe") If InStr(1,MCEver,"5.1.2600") = 1 then MCEbuild = Right("0" & MCEver, 4) If MCEbuild < "1217" then WScript.Echo "Windows XP Media Center Edition: 2002" ElseIf MCEbuild => "1217" then WScript.Echo "Windows XP Media Center Edition: 2004" End If ElseIf InStr(1,MCEver,"5.1.27") = 1 then WScript.Echo "Windows XP Media Center Edition: 2005" ElseIf InStr(1,MCEver,"6.0") = 1 then WScript.Echo "Windows Media Center in Windows Vista" ElseIf InStr(1,MCEver,"6.1") = 1 then WScript.Echo "Windows Media Center in Windows 7" Else WScript.Echo "Media Center File Version: " & MCEver End If Else WScript.Echo "Media Center: NOT FOUND" End If
May I ask the purpose of this script, other than the obvious "see if you have MCE 2005"..?? -Just curious..
I just wanted to make sure the script works before i integrate it with a another script i'm working on i hope you don't mine
No problem, it is very simple to just figure any version, and if the MEDIA CENTER was even installed..the OEMBIOS changer tool does it nicely with a BAT file.. The ident strings can identify any version up to windows 7...
This vb script (.vbs) uses the registry like the bat script above Code: ' ' WinNT: XP Media Center Edition / Windows Media Center ' Created By 38956 ' 21100819.4 Alpha 1300 Dim objShell Set objShell = CreateObject("WScript.Shell") keyWinCurrentVersion = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Media Center\" strMCident = objShell.RegRead(keyWinCurrentVersion & "Ident") If strMCident > "5.9" then WScript.Echo "Windows Media Center in Windows 7" ElseIf strMCident > "4.9" then WScript.Echo "Windows Media Center in Windows Vista" ElseIf strMCident > "3.9" then WScript.Echo "Windows XP Media Center Edition 2005 (Rollup 2)" ElseIf strMCident > "3.0" then WScript.Echo "Windows XP Media Center Edition 2005 (Rollup 1)" ElseIf strMCident > "2.9" then WScript.Echo "Windows XP Media Center Edition 2005" ElseIf strMCident => "2.7" then WScript.Echo "Windows XP Media Center Edition 2004" ElseIf strMCident < "2.7" then WScript.Echo "Windows XP Media Center Edition 2002" Else WScript.Echo strMCident End If