Hai monks...
I have two problems in the bellow code.
1) In the bellow code the execution stops after executing the code system('"%windir%\system32\mstsc.exe"');(opening Remote Desktop Connection), And restarts when I close the window poped by the exicution of it. To get the output I got to open another window of the same (mstsc.exe/Remote Desktop Connection) before closing the opened window. now it takes the other window for further execution.
2)After executing the code SendKeys("{ENTER}"); the process must wait till another window appears, but before the popup window appears, the process terminates without executing the following code. I tried with usleep(500000); with use Time::HiRes qw(usleep);, but it is also of no use.
use Win32::GuiTest qw(FindWindowLike GetWindowText SetForegroundWindow SendKeys); system('"%windir%\system32\mstsc.exe"'); $Win32::GuiTest::debug = 0; my @windows = FindWindowLike(0, "Remote Desktop Connection"); for (@windows) { print "$_>\t'", GetWindowText($_), "'\n"; SetForegroundWindow($_); SendKeys("{ENTER}"); my @windows1 = FindWindowLike(0, "Windows Security",10); for (@windows1) { print "$_>\t'", GetWindowText($_), "'\n"; SetForegroundWindow($_); SendKeys("P@ssword01"); } }
Please help in solving these.
Thanks in advance.
Pradeep Krishna. :)
In reply to Controlling the execution. by pradeep,krishna
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |