Solutions for shutting down Remote Desktop Connection in UI Automation, mouse and keyboard invalidation

Source: Internet
Author: User
Tags mstsc

problem cause Analysis:Because a remote Desktop connection is initiated through MSTSC, the connected Windows initiates a session. At this point, all the operations (mouse, keyboard) in the Remote Desktop window will be ' translated ' into the TCP packet transmission in the past, after the connected Windows receive these packages, the ' Restore ' command and execute on the current active session. When you disconnect (point x is OFF) and the session becomes disconnected, Windows automatically closes the session (this is inaccurate, in fact the session is still in place, but the state becomes disconnected), which causes all GUI-based operations to ' fail '.
When you minimize Remote Desktop, Windows will temporarily ' shut down the session ' to conserve network bandwidth, causing your simulation to fail.
Initial level of two solutions: 1. To the remote computer, log in, then off the monitor, leave, remember not to telnet to it; 2.   Remote connections, never off, or minimized. Of course I also have a better solution, my solution can be the Remote Desktop window to minimize or close without affecting the simulation keyboard mouse script.1. Window minimization Failure Solution: Modify registry key (Note: Connect machine B from machine a via Remote Desktop, you need to modify the registry on Machine a)32-bit machine:Hkey_current_usersoftwaremicrosoftterminal Server clientremotedesktop_suppresswhenminimized or HKEY_LOCAL_ Machinesoftwaremicrosoftterminal Server clientremotedesktop_suppresswhenminimized Set data type DWORD with a value of 264-bit machine paths are different: hkey_current_usersoftwarewow6432nodemicrosoftterminal Server clientremotedesktop_suppresswhenminimized or HKEY_ Local_machinesoftwarewow6432nodemicrosoftterminal Server clientremotedesktop_suppresswhenminimized Set data type DWORD, Value of 22. Solution for shutdown failure:Remote Desktop MSTSC When you telnet to a virtual machine, create a new text document in the VM, write the content @%windir%\system32\tscon.exe 0/dest:console @%windir%\system32\tscon.exe 1/dest : Console @%windir%\system32\tscon.exe 2/dest:console Rename the text document to ' CLOSE_RDP ' and change the suffix name to '. Bat ', double-click the file ' Enablecloserdp.bat '       Shut down the virtual machine, and the script with Sendkey after the virtual office is closed can run normally. Reference: http://support.smartbear.com/viewarticle/30747/http://www.networkautomation.com/urc/knowledgebase/ running-interactive-tasks-in-minimized-remote-desktop-windows/4ecdf43e03470/http://www.ranorex.com/forum/ Running-automation-via-remote-desktop-t1295.html
Reprint Please specify source: Http://blog.csdn.net/sogouauto

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.