Find Out currently Logged On Username Via CMD in Windows PC

One of the highlighting features of Windows 10 is it’s ability to manage multiple user accounts. But suppose that you had left your laptop somewhere and later you find that it has been unlocked. Only a person who knows the password of any one of the user accounts should have done that. We would obviously be curious to know which user has been logged in. This can be done either locally on your computer or remotely from any other computer. This process doesn’t require any installation of third party apps. It can easily be accomplished from the command prompt.

Also read: – How to know who logged into your PC in your absence and When

Let us now navigate through the steps you need to follow in order to find out who is currently logged on to your Windows 1o system. This can be accomplished in three ways : Using query user, wmic or whoami command.Follow them in the order given below.


METHOD 1: Using the Whoami Command

This basically stands for Who Am I? When this command is entered, the currently working user is displayed in the command prompt.

  • Open up the Run window by pressing the Windows key + R.

opening run

  • On the text box provided at the bottom, type cmd and hit Enter.

typing cmd

  • Once the window of the command prompt opens up, you will have to type the command whoami and hit the Enter button

whoami command

The current users and details as shown in the screenshot above appears on the window.

METHOD 2: Making Use of the Command – Query User

This is another command to display the information. What makes it different from the above method is that, this can be accomplished either locally or remotely.

For Local computer

  • Open up the Run window by pressing the Windows Key +R. Type the text cmd in the box provided and hit Enter.

typing cmd

  • Once the command prompt opens up, you will have to type the command query user.
  • On hitting the Enter button, you will get all the details associated with the user.

query user local

From A Remote Computer

Suppose that you are in another computer and you need to know who is logged on to your system. Follow the below given steps.

  • Open up the command prompt form the Run window as described above.

typing cmd

  • When it prompts you to enter the command, type the below given command.

query user /server:computername

remote query command

Computername in the above command is the name of the system for which you need to get the details. In my case, it is hp. Ensure that you provide it in the proper format.

METHOD 3: By Using the wmic command

This stands for Windows Management Instrumentation Command-line that provides a scripting experience for all the computer that are connected through WMI. There are various versions for it. Here, we will use it to find user details.

  • Open up the Command Prompt from the Run Window by typing cmd in its text box.

typing cmd

  • Type in there, the below given command.


wmic command


SYSTEMNAME in the above command should be replaced by the name of the system queried for. You will get the details as shown above.

That’s it. Hope you found this article useful.