mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Re: VT_ARRAY when retrieving COM results [Re: Khaled] #267248 27/04/20 02:32 PM
Joined: Jul 2006
Posts: 3,697
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,697
I stated doing that is not working and figured it was not a bug.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: VT_ARRAY when retrieving COM results [Re: Wims] #267249 27/04/20 02:58 PM
Joined: Dec 2002
Posts: 4,727
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,727
I just tested this and it seems to be working. I used the following script:

Code
test {
  echo 1 $regread(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation)
  echo 1 $regread(HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName)
  echo 1 $regread(HKEY_LOCAL_MACHINE\SOFTWARE\Intel\PSIS\PSIS_DECODER\GraphFile)
  echo 1 $regread(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole\DefaultLaunchPermission)
  echo 1 $regread(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations)
}

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, &v).result
  echo 3 len: $bvar(&v,0) data: $bvar(&v,1-1024).text
  :error
  if ($error) reseterror
  if ($com(a)) .comclose a
  return %err %b
}

Each of the above calls fills the binary variable with the expected result here.

"DefaultLaunchPermission" is a REG_BINARY and "PendingFileRenameOperations" is a REG_MULTI_SZ.

Re: VT_ARRAY when retrieving COM results [Re: Khaled] #267250 27/04/20 03:07 PM
Joined: Jul 2006
Posts: 3,697
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,697
It works for me on all of those examples, but it fails on many others example.

The code is the same as what I provided (with the inclusion of the &v parameter, which I had tried, obviously), so it's not something that has to do with the code but with my machine.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Page 2 of 2 1 2