' From http://technet.microsoft.com/en-us/scriptcenter/default.aspx
' This returns a list of all the registered file extensions 
' using the WMI registry provider to connect to
' the computer identified in the strComputer variable.

Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 
    strComputer & "\root\default:StdRegProv")
 

strRootKeyPath = "SOFTWARE\Classes"
objReg.EnumKey HKEY_LOCAL_MACHINE, strRootKeyPath, arrSubKeys
 
For Each objSubKey In arrSubKeys
   If Left(objSubKey,1) = "." Then
      WScript.StdOut.Write " " & objSubKey 
      strKeyPath = "SOFTWARE\Classes\" & objSubkey
      strValueName = ""
      objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
      WScript.StdOut.Write  " " & strValue
      If Not IsNull(strValue) Then
         strKeyPath = "SOFTWARE\Classes\" & strValue
         strValueName = ""
         objReg.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strNewValue
         WScript.Echo  " " & strNewValue
      Else
         WScript.Echo
      End If
   ElseIf Not Left(objSubKey,1) = "*" Then
      WScript.Quit
   End If
Next

