Solved Windows command line - create a list of current users.

March 3, 2013 at 02:24:17
Specs: Windows 7, 4GB
Hello, I was wondering... How to make a list of users?
4 ex:
when I type 'net users' I get:

Administrator ASPNET Guest
Titas UpdatusUser
The command completed successfully.

How to put all these names into a txt file like this? :

Administrator
ASPNET
Guest
Titas
UpdatusUser

Thankyou 4 your answer


See More: Windows command line - create a list of current users.

Report •

#1
March 3, 2013 at 06:09:54
✔ Best Answer
Think this works:
net users>users.txt

Only thing is finding where the list goes. If you run it as yourself (no administrative permissions) it appears in your user folder.


Report •

#2
March 3, 2013 at 10:57:34
@echo off
for /f "skip=4 tokens=1-3" %%a in ('net user ^|find /v "The command completed successfully."') do (
echo.%%a
echo.%%b
echo.%%c
)>>userlist

Report •
Related Solutions


Ask Question