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
-MarkI'd like to have the output without the lines and columns. Maybe with a findstr command.
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.
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