How do you find the current user in a Windows environment?

Geo picture Geo · Oct 22, 2009 · Viewed 339.3k times · Source

When running a command-line script, is it possible to get the name of the current user?

Answer

JRL picture JRL · Oct 22, 2009

You can use the username variable: %USERNAME%