How to find computer name using Command Prompt

Here’s a quick way to find out your computer’s name, something you might need often (like, when you are trying to connect a printer to multiple PCs). This method makes use of the command prompt in Windows.
 
1. Click on the start button, type cmd in the search box (In windows XP and older version, open 
    run command, type cmd and press enter). Click on the result.
 
 
2. A command prompt window will open up. Type the word "hostname” without quotation mark
    and press enter.
 
 
3. Your computer name will appear. In my case it is “sony-VAIO”.
 
 
This way you can easily find your computer’s name. Simple and quick.