VBS Check Windows Session Console or Remote Desktop

Molto utile può essere uno scripts che controlla se la sessione Windows è quella di Console oppure in Desktop Remoto

Function Is_Console_Session()

	Dim result
	result = False

	Set oShell = CreateObject( "WScript.Shell" ) 
	connection=oShell.ExpandEnvironmentStrings("%SESSIONNAME%") 


	If connection = "Console" Then
		result = True
	End If


        Is_Console_Session = result

End Function


MsgBox "Sessione Console = " & Is_Console_Session()

Per maggiori informazioni:
http://stackoverflow.com/questions/2382959/how-do-i-determine-if-vbscript-is-running-in-rdp-console

This entry was posted in VBScript. Bookmark the permalink.