Computer and Domain Name in NT, 95 and 98

I need to find the computer name and domain name in Windows NT and Windows 95 and '98.

I found some functions which work only for Windows NT. Does anybody know how to retrieve this information thru program.

sgargAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mcriderCommented:
Read the Registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP\Domain

Cheers!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sgargAuthor Commented:
No such key in my machine.
0
sgargAuthor Commented:
The answer got accepted by mistake.
I wanted to reject it.
0
mcriderCommented:
You can use the following microsoft article... It does a gethostname API call.

The API will return the complete domain name.... All you have to do is strip off everything before the first dot in the string thats returned...

HOWTO: Obtain the Host IP Address Using Windows Sockets
http://support.microsoft.com/support/kb/articles/Q160/2/15.asp 
 

Cheers!
0
mcriderCommented:
by the way, there are 2 typo's in the example on that web page...

the declaration for gethostname and RtlMoveMemory should have a space before the _ character that splits the lines.

Cheers!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.