Hi!
I'm triying to get the session id to close automatically a RDP session.
I tried doing this:
#RequireAdmin
#include <Constants.au3>
$DOS = Run('C:\Windows\System32\query.exe user', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
;Run(@ComSpec & " /c " & 'Query User', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
;Run(@ComSpec & " /c " & 'quser', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
ProcessWaitClose($DOS)
$Message = StdoutRead($DOS)
MsgBox(0,'',$Message)
But the $Message is always empty, if I execute any of these commands in a cmd window, it works
Any idea on why is this falling? there is another way to get this info?
PS: Sorry for my english, i'm not native.