Using Windows 7. When I RDP to a PC I'd like to be able to logout of the session without the screen reverting to a Ctrl+Alt+Del Login screen.

The PC's in question are kiosks running Chrome in full screen 'Kiosk Mode'. So it's important they revert back to the normal browser home page.

I have successfully managed to do logout by creating a .bat file in C:\bat called rdp_logout.bat. The contents of this .bat file are below;

tscon.exe 2 /dest:console

I then created a shortcut on my desktop to this .bat file (send to > desktop). I changed the permissions of the .bat file to run as administrator. When I want to logout of the 'Kiosk' I do the following;

  • Open the browser in Kiosk Mode
  • WinKey+R
  • Input "cmd"
  • Enter

This opens the command prompt (on top of) the browser with the following displayed;


I then type;

cd Desktop

"rdp_logout.bat - Shortcut.lnk"

This does run, and logs me out. However whenever I RDP to the same PC immediately afterwards, the command prompt window is still showing 'on top' of the browser.

What do I need to change in order to hide the command window after the .bat files has ran?

  • Don't open a command prompt, just press windows + R and run this directly: %userprofile%\desktop\rdp_logout.bat – Ricardo Bohner Nov 27 '19 at 13:27

Try this.

Timeout 2
taskill /f /cmd.exe

to the end of you .bat

This will Kill the window to kill itself after you log out. The Pause is so it does not kill it before your logout command runs.

| improve this answer | |

You don't have to create bat file, just:

  • Win+R
  • paste your command: tscon.exe 2 /dest:console

  • hit enter

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.