How can I get a plain list of computer names on the network from "net view"?

I am using the net view command. It displays the users on the network in big and ugly UPPERCASE letters and has columns etc., for example:

Server Name Remark
-------------------------------------------------------------------------------
\\ADRIAN-PC
\\MARK-PC
The command completed successfully.

Is there a way for me just to display the computer names on the network?

-Adrian
-Mark

I'd like to have the output without the lines and columns. Maybe with a findstr command.

1

2 Answers

(for /f %a in ('net view ^| findstr/b \\\\') do @echo %a)

You cannot (or should not) remove the -PC suffix, since you are not listing usernames – you are listing computer names, and the suffix is part of the computer name.

5

Net View displays domain/workgroup resources, i.e server and PC resources. It doesn’t give an accurate overview of machines on the network as that’s not it’s complete role. You need to use ARP –a to get this and translate them to their hostnames.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like