Check who is logged into a machine
From time to time you may wish to find out who is logged into a machine. I find this batch file handy for doing this. Its quick, simple and easy.
Just copy and paste the below code into notepad and save the file as who.bat
@echo off :CHECK echo Checking Connection ... ping %1 -n 1 | findstr "TTL=" >nul && GOTO MAIN || GOTO ERROR GOTO END :ERROR echo Device Unreachable GOTO END :MAIN wmic /node: "%1" computersystem get username GOTO END :END echo.
Now open the command prompt. run to the location of the script then a space then the name of the machine. For example
C:\who.bat Computer1
All Done!

3 Comments
Recommended Comments
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now