I am looking for an efficient means of determining which file extension classes will directly open an associated application. I want to create an index on logon so in a Intranet environment only the file & templates directly openable/shellable on the local machine are listed. No point listing a ###.XYZ file if it cant be opened by clicking on it!
On investigating the classes on my pc, the ways of opening files are NUMEROUS and not simple to narrow down.
I am experimenting with the following test script but there is probably a more direct method so seeking advice....
 Code:
break on
Classes
get $a
Function CLASSES
;Machines CLASSES information.

  GLOBAL $base
  GLOBAL $output
  GLOBAL $#

  $base="HKEY_CLASSES_ROOT\"
  $output="%USERPROFILE%\DESKTOP\%COMPUTERNAME%_CLASSES.txt"
  $apps="%USERPROFILE%\DESKTOP\%COMPUTERNAME%_Apps.txt"
  $#=","
  IF exist ($output)
   DEL $output /f
  ENDIF
  IF exist ($apps)
   DEL $apps /f
  ENDIF

  DIM $nul
  Open(2, $output,5)
  Open(3, $apps,5)
  If @error = 0
   $null = ParseKeys() ; Run Query
  Endif
  Close (2)
  CLose (3)
EndFunction

FUNCTION Parsekeys()
  DIM $subkey
  DIM $retvalue
  $retvalue = ENUMKEY($base,$subkey)
  WHILE @error=0
   IF $retvalue <> "" and left($retvalue,1) = "."
    $null = LogKeys($retvalue)
   ENDIF
   $subkey=$subkey+1
   $retvalue = ENUMKEY($base,$subkey)
  LOOP
ENDFUNCTION

FUNCTION LogKeys($keyname)
   DIM $x
   DIM $scounter
   DIM $key
   $key=$base+$keyname
    $x = ENUMKEY($key,$scounter)
   WHILE @error=0
    ShellOpen($key,$Keyname,$x)
;This gives a nice list or .### file types currently registered.
    WRITELINE (2, $keyname+@crlf)
    $scounter=$scounter+1
    $x = ENUMKEY($key,$scounter)
   LOOP
ENDFUNCTION

FUNCTION ShellOpen($key,$keyname,$x)
;Need ideas what to look for to determine which .### run associated application!
    SELECT
    CASE $x = "OpenWithProgIDs"
     OpenWithProgIDs($key,$Keyname,$x)
    CASE $x = "shellex"
     shellex($key,$Keyname,$x)
    CASE $x = "OpenWithList"
     OpenWithList($key,$Keyname,$x)
    ENDSELECT
ENDFUNCTION

FUNCTION OpenWithProgIDs($key,$keyname,$x)
? $x
ENDFUNCTION

FUNCTION shellex($key,$keyname,$x)
? $x
ENDFUNCTION

FUNCTION OpenWithList($key,$keyname,$x)
? $X
ENDFUNCTION