in reply to Re: How to execute win32 functions when the user session is locked.
in thread How to execute win32 functions when the user session is locked.
I tried to execute the bellow perl script and locked the user session...
It worked as usual without any extra code..., There was no output when i locked the session, as i locked the session before the next second.$n=15; while($n>0) { print "$n,"; $n--; sleep(1); }
C:\Pradeep>perl test.pl 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1, C:\Pradeep>
use Win32::GuiTest qw(FindWindowLike GetWindowText SetForegroundWindow + SendKeys); system('"start %windir%\system32\mstsc.exe"'); $Win32::GuiTest::debug = 0; $max_Sleep_time=3; $Cur_Sleep_time=0; do { sleep(1); @windows = FindWindowLike(0, "Remote Desktop Connection"); $number_of_windows_opend = scalar(@windows); $Cur_Sleep_time++; }while ($number_of_windows_opend==0&&$Cur_Sleep_time!=$max_Sleep_time) +; for (@windows) { SetForegroundWindow($_); SendKeys("server_name"); SendKeys("{ENTER}"); sleep(10); @windows_seq = FindWindowLike(0, "Windows Security"); for (@windows_seq) { SetForegroundWindow($_); SendKeys("Password01"); SendKeys("{ENTER}"); } @windows={}; exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to execute win32 functions when the user session is locked.
by Anonymous Monk on Feb 05, 2014 at 07:44 UTC | |
|
Re^3: How to execute win32 functions when the user session is locked.
by bulk88 (Priest) on Feb 06, 2014 at 05:16 UTC | |
by Anonymous Monk on Feb 06, 2014 at 08:41 UTC |