ShareYourGroupShareYourGroupCommands

Windows commands

systeminfo, ver, whoami and shutdown: about this computer

A handful of commands report on the computer itself: which version of Windows it runs, what it is called, who is signed in. One more, shutdown, turns it off or restarts it, at once or after a delay.

These were not run for this page, because the answers would describe a real computer. The sample outputs are illustrations.

Which Windows is this?

Windows Command Prompt not run here
ver
What the output looks like an illustration, not a real run
Microsoft Windows [Version 10.0.26100.2314]

The number is the build. Windows 11 version numbers still begin with 10.0. The build tells them apart: builds from 22000 upwards are Windows 11.

winver opens a small window with the same information in friendlier words.

systeminfo

Windows Command Prompt not run here
systeminfo

It takes a few seconds and prints a page of facts: the Windows edition and version, when it was installed, when the computer last started, the maker and model, the processor, the amount of memory, the network cards and the updates installed.

To pick out one line, filter with findstr:

Windows Command Prompt not run here
systeminfo | findstr /c:"OS Name" /c:"Total Physical Memory" /c:"System Boot Time"
What the output looks like an illustration, not a real run
OS Name:                   Microsoft Windows 11 Home
System Boot Time:          10-11-2026, 08:42:17
Total Physical Memory:     16,154 MB

"System Boot Time" is useful: a computer that has not restarted for weeks often behaves better after it does.

Who and where

Windows Command Prompt not run here
whoami
hostname

whoami prints the computer name and the account you are signed in with. hostname prints the computer's name alone. whoami /groups lists the groups the account belongs to, which shows whether it is an administrator.

Disks

Windows Command Prompt not run here
wmic logicaldisk get name,size,freespace

This older command lists each drive with its size and free space in bytes. On recent versions of Windows, wmic may not be installed. PowerShell's Get-Volume gives the same information in a neater form.

shutdown

shutdown needs a switch saying what to do.

CommandEffect
shutdown /sshut down after a short warning
shutdown /rrestart
shutdown /lsign out
shutdown /hhibernate
shutdown /aabort a shutdown that is counting down
shutdown /s /t 0shut down immediately
shutdown /r /orestart into the advanced start-up menu

/t sets the delay in seconds. Without it, the default is thirty seconds for /s and /r.

A timed shutdown

To turn the computer off in one hour, for instance after a long download:

Windows Command Prompt not run here
shutdown /s /t 3600

Windows shows a notice. To cancel at any time before it happens:

Windows Command Prompt not run here
shutdown /a

Add a message for whoever is at the screen with /c "text".

Danger. shutdown /s /t 0 and /f close programs without waiting. Unsaved work is lost. Save everything first. And do not leave a timed shutdown running on a computer someone else is using.

Restarting properly

Since Windows 8, an ordinary Shut down from the Start menu does not fully stop Windows. A feature called Fast Startup saves part of the system to disk to start more quickly next time. A Restart does a full reload. When a computer is misbehaving and someone advises restarting it, use Restart, or shutdown /r, not Shut down and power on.

Locking the screen

There is no lock command, but this line does it:

Windows Command Prompt not run here
rundll32.exe user32.dll,LockWorkStation

Win + L is easier at the keyboard. The command form is for scripts and shortcuts.

Repair commands you may be told to run

Two commands appear often in troubleshooting advice. Both need a Command Prompt opened as administrator.

Windows Command Prompt not run here
sfc /scannow
chkdsk C:

Danger. Do not interrupt chkdsk /f or /r once it has started repairing, and do not run it on a disk that is making unusual noises or failing. Copy your files off a failing disk first. Repair comes second.

Help for any command

help lists the built-in commands, and command /? explains one. Both are on the computer and need no internet.

Examples shown with output were run on 12 November 2026 in a practice folder: Windows commands in cmd.exe on Windows 11, Linux commands with the GNU tools of Git Bash. The folder path and user name were replaced with made-up ones. Commands marked "not run here" are shown as you would type them.

This is an independent learning site. It is not connected with Microsoft, Apple or any Linux distribution. Windows, macOS and other names belong to their owners. Try commands first in a practice folder, never on files you cannot afford to lose.