Close remote desktop session and launch an executable


  1. Posts : 21
    Windows 10 Pro 64 bit
       #1

    Close remote desktop session and launch an executable


    Having a Windows 10 Enteriprise 2016 LTSB installed on an industrial PC for a totem with a touch screen.

    This PC run a client application, for simple operations I need sometimes to access the PC with Remote Desktop from a remote location.

    Finished my activity if I simply exit from Remote Desktop the PC will show a login screen to the users, obviously not what wanted

    Using a .bat script with
    Code:
    tscon.exe 1 /dest:console
    as administrator I'm able to leave the session and the PC didn't show the login screen, but shows the desktop, again not what I wanted.

    Adding this command before the other
    Code:
    start "" "C:\Users\User\Desktop\BikeCube\BikeCube.exe"
    it launch the client but didn't close the session.

    There is a way to close the session and immediately launch the client, or the opposite.
    The final status need to be the the touch screen with the client app opened.
      My Computer


  2. Posts : 981
    W10 Pro v21H2
       #2

    Could you simply set up the totem pc to automatically start the client on boot, then send shutdown /r command to end the remote session, shutting down the totem pc, rebooting to the client?
      My Computers


  3. Posts : 21
    Windows 10 Pro 64 bit
    Thread Starter
       #3

    I already tried that, but the reboot can be long due to updates and also the client didn't load immediately, so the users can look at the win desktop for about 10 sec and eventually do any action.
    The first problem I can solve disabling Win10 update with some trick, but for the second there is a way to blanck the screen till the client is loaded?
      My Computer


  4. Posts : 981
    W10 Pro v21H2
       #4

    It sounds like you not only need to blank the display, but also block any input until the client is successfully launched. I am afraid I do not know how to do either one. Hopefully someone here with knowledge of Enterprise and Client computing will catch this thread.
      My Computers


  5. Posts : 21
    Windows 10 Pro 64 bit
    Thread Starter
       #5

    Or otherwise find a way to make it work the script of the first post.
    Ideal will be no reboot, just leave remote session and restart the client.
      My Computer


  6. Posts : 981
    W10 Pro v21H2
       #6

    Check out the call and Cmd commands here:

    https://docs.microsoft.com/en-us/win...-commands/call

    You could put the remote session close command in its own batch file called tsession.bat, and call it from the batch file that ends with running the client app, like:

    call tsession.bat
    start "" "C:\Users\User\Desktop\BikeCube\BikeCube.exe"




    Or use the Cmd to open a separate instance of cmd.exe, issue the session closer there, then continue with the batch command to start the client:

    cmd /c "tscon.exe 1 /dest:console"
    start "" "C:\Users\User\Desktop\BikeCube\BikeCube.exe"


    Please do be sure and back up everything before you try any of these .... I'm no expert.
      My Computers


  7. Posts : 21
    Windows 10 Pro 64 bit
    Thread Starter
       #7


    cmd /c "tscon.exe 1 /dest:console"
    start "" "C:\Users\User\Desktop\BikeCube\BikeCube.exe"


    This is working, thanks.

    The only minor problem is on the remote desktop the console does remain open behind the launched application. Any way to close it after launching the app?
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:54.
Find Us




Windows 10 Forums