If a script had to make look up loads of reg entries, I'd probably make a custom version of the regread alias just for it. One that would keep the COM open as long as it's needed.



EDIT:
Forgot to try one more thing, and it sped up the script even more, although the difference is only about 10 ms when doing 50,000 times.
Code:
alias regread if (!$~com(r)) !.comopen r WScript.Shell | !noop $~com(r,RegRead,3,bstr,$~1) | !return $~com(r).result

Last edited by Dazuz; 10/08/16 07:00 PM.