SessionName

From Environment Variables
Jump to: navigation, search

The SessionName variable is only defined if the Terminal Services system component is installed to the Windows XP clients or newer. [1]

When a client connects via a terminal server session, SessionName environment variable is a combination of the connection name, followed by a pound symbol {#} and then the session number.

echo %SessionName%
RDP-Tcp#1

When logging on directly to the machine, SessionName environment variable returns "Console".

echo %SessionName%
Console

Default value

SessionName environment variable doesn't have default value.

References

  1. Environment Variable Reference

See also

AllUsersProfile | AppData | CD | ClientName | CmdCmdLine | CmdExtVersion | CommonProgramFiles | ComputerName | ComSpec | Date | ErrorLevel | HomeDrive | HomePath | LocalAppData | LogonServer | Number Of Processors | OS | Path | PathExt | Processor Architecture | Processor Identifier | Processor Level | Processor Revision | ProgramFiles | Prompt | Random | SessionName | SystemDrive | SystemRoot | Temp | Time | Tmp | UserDnsDomain | UserDomain | UserName | UserProfile | WinDir


Personal tools
Namespaces

Variants
Actions
Navigation
Catalogue
Google AdSense
Tools