Thanks you for improving $comval() for more array support.

I have found some issue with the RegRead method : https://www.vbsedit.com/html/1b567504-59f4-40a9-b586-0be49ab3a015.asp

There are some path which I can see in regedit.exe which report an error for the RegRead $com call function, but it works otherwise, no idea why.

Code
The RegRead method returns values of the following five types.

Type		Description						In the Form of

REG_SZ		A string						A string

REG_DWORD	A number						An integer

REG_BINARY	A binary value						A VBArray of integers

REG_EXPAND_SZ	An expandable string (e.g., "%windir%\\calc.exe")	A string

REG_MULTI_SZ	An array of strings					A VBArray of strings




Whenever the path is ok, REG_SZ and REG_DWORD type are returning correct value (I would think REG_EXPAND_SZ also works, did not try).

Code
alias regread {
  .comopen a WScript.Shell
  var %err OK,%b
  if ($comerr) var %err COM_ERR
  elseif (!$com(a,RegRead,3,bstr,$1)) || ($comerr) var %err COM_ERR
  else %b = $com(a).result
  :error
  if ($error) reseterror
  if ($com(a)) .comclose a
  return %err %b
}


What works:
$regread(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation) return 0 if short finename is enabled, 1 if it's disabled (REG_DWORD)
$regread(HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName) returns the name of the operating system (REG_SZ - use abbreviated HKLM root item)
$regread(HKEY_LOCAL_MACHINE\SOFTWARE\Intel\PSIS\PSIS_DECODER\GraphFile) (REG_SZ)


What doesn't work:
$regread(HKEY_LOCAL_MACHINE\SOFTWARE\videoLAN\VLC\Language) (REG_SZ)

In the regedit editor, the key is literaly like this, with lower case for 'video', but note that the path alone can be tested, for invalid path you get a com error, for valid path, no com error:

$regread(HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\) is OK while $regread(HKEY_LOCAL_MACHINE\SOFTWARE\videoLAN\) is COM_ERR,

And here is another failing example $regread(HKEY_LOCAL_MACHINE\SOFTWARE\Realtek\Network\install)
but this time $regread(HKEY_LOCAL_MACHINE\SOFTWARE\Realtek\) is OK while $regread(HKEY_LOCAL_MACHINE\SOFTWARE\Realtek\Network\) isn't, it's pretty weird to me.


In any case, I'd like to get support for REG_BINARY and REG_MULTI_SZ when we use $com(name,&binvar).result, I tried REG_BINARY but $com seems to return 0. Are they supposed to work? I believe not.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel