Jump to content

Recommended Posts

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...