Terminal Services Session ID


Windows Terminal Services provides the ability for several users to run Windows-based applications on a single server. The applications for each user run in a session. Each session is assigned a unique number. The "Store Terminal Services Session ID" command allows a macro to obtain this session ID number.



Script Editor > Expand System Category > Terminal Services Session ID



Some resources, such as the hard drive, may be shared between sessions. If a macro attempts to write to and then read from a file, macros used by different sessions may attempt to write to or read from the same file. This can lead to file corruption. By using the Session ID as part of the filename, the macro running on each session is assured of using a unique filename.


The session ID can be saved in either a text string variable or as an integer variable.