Skip to content

Instantly share code, notes, and snippets.

@rafaelfoster
Created November 29, 2013 14:45
Show Gist options
  • Save rafaelfoster/7706739 to your computer and use it in GitHub Desktop.
Save rafaelfoster/7706739 to your computer and use it in GitHub Desktop.
VBS Detect session (if RDP or Local console)
Set WshShell = CreateObject("WScript.Shell")
strSessionName = wshShell.ExpandEnvironmentStrings( "%SESSIONNAME%" )
if ( inStr(LCase(strSessionName),"rdp") <> 0 ) Then
' Do something
End If
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment