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