Windows Command Line.. How to get domain and PC name

SinNisTeR

Diamond Member
Jan 3, 2001
3,570
0
0
I know I can do "hostname" to get the machine name.. but what about the domain name? Or how about searching in string like java or c# InString()? Anything like it in command line? Thanks!
 

Noobsa44

Member
Jun 7, 2005
65
0
0
Are you trying to create a console program that gets the PC name and domain name or do you want to get this from already created command line tools?

If you are trying to create a console, I believe you can use System.Environment.UserDomainName and System.Environment.UserName in C#/VB.NET.
 

SinNisTeR

Diamond Member
Jan 3, 2001
3,570
0
0
I'm trying to do this from existing windows command line. I know that in C# and other programming languages this is easily available.