I searched for matches using WSH's REGREAD and READ / READING REGISTRY KEY / KEYS and this is the
only thread I found which answered my current problem.
I am trying to populate the network logon username to older computers. I have an older DOS program to maintain that can read the DOS SET variables but is blind to the Windows environment. Windows XP and 2000 have a USERNAME variable available in the Command Prompt (DOS) windows, but not Windows Me, 98se or 98. So I have to create my own variable. So I decided to test first for the registry key below whether it is an NT-class computer.
[tt]HKLM\System\CurrentControlSet\Control\Session Manager\Environment\OS[/tt]
Well, guess what, Windows XP/2000 contain "Windows NT". But in Windows Me/98/98se it doesn't exist and it creates error 80070002. At first I though I should at least get a data type back as Undefined (vartype of 8 is "U"

but not even that could I get.
I even tried these trees, but either one is used or the other, not both:
[tt]HKLM\Machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Version
HKLM\Machine\Software\Microsoft\Windows NT\CurrentVersion\Version
====================================================================[/tt]
So until I locate a key which both Windows families share and which tell which family it is, I'll have to use the above suggestion to handle the error: test for an error and reset the error handler using error.clear as appropriate.
Thanks, dbMark