I am using .bat script to disconnect from RDP session with
Code: Select all
tscon.exe 1 /dest:console
Code: Select all
C:\Windows\System32\cmd.exe /c "tscon.exe 1 /dest:console"
Now I would like to do the same thing using AHK,
I have this code
Code: Select all
If Not A_IsAdmin
{
try
{
Run, *RunAs %ComSpec% /c "cmd.exe /c "tscon.exe 1 /dest:console""
}
Exitapp
}
Return
but when I compile this script and run that executable file, nothing is happened, my RDP session is still on.
Not sure where is the problem?
Just to mention if I run some other command (as administrator), for example:
Code: Select all
Run, *RunAs %ComSpec% /c "cmd.exe /c "chkdsk c:"