Windows XP Media Center Edition detect version (vb script needs testing)

Discussion in 'Windows XP / Older OS' started by 38956, Aug 19, 2010.

  1. 38956

    38956 MDL Member

    Jun 7, 2010
    130
    138
    10
    #1 38956, Aug 19, 2010
    Last edited by a moderator: Apr 20, 2017
    [.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
    
     
  2. 911medic

    911medic MDL Guru

    Aug 13, 2008
    5,778
    490
    180
    May I ask the purpose of this script, other than the obvious "see if you have MCE 2005"..??

    -Just curious..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. 38956

    38956 MDL Member

    Jun 7, 2010
    130
    138
    10
    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
     
  4. 911medic

    911medic MDL Guru

    Aug 13, 2008
    5,778
    490
    180
    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...

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. 38956

    38956 MDL Member

    Jun 7, 2010
    130
    138
    10
    Thank you for the bat script code 911medic
     
  6. 38956

    38956 MDL Member

    Jun 7, 2010
    130
    138
    10
    #6 38956, Aug 19, 2010
    Last edited by a moderator: Apr 20, 2017
    (OP)
    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