Or a one-liner:
Windows automatically keeps a bunch of environment variables that can be read by any program. This includes username as mentioned above, but also other useful information such as:
- installation directory for windows ("windir")
- your personal directory ("userprofile")
- the location of your program file directory ("programfiles")
and a bunch of other info. To see the full list, open a DOS command prompt (cmd.exe), and simply type: set
Print getenv_("username")
Windows automatically keeps a bunch of environment variables that can be read by any program. This includes username as mentioned above, but also other useful information such as:
- installation directory for windows ("windir")
- your personal directory ("userprofile")
- the location of your program file directory ("programfiles")
and a bunch of other info. To see the full list, open a DOS command prompt (cmd.exe), and simply type: set