Friday, June 4, 2010

Windows : System Unlock

Automation testing during application idle time may get affected if the system locks.
There are many ways in preventing the same, one would be pass a keyboard event at regular intervals.

PS: Take care the key pressed does not any impact on the script run.

*************************************************************************
'Pass Numlock key evnet every 10 sec
'To get the keywords for other keys refer MSDN site

set WshShell = WScript.CreateObject("WScript.Shell")
Dim i
i = 11
MsgBox i
While i > 10
WshShell.SendKeys "{NUMLOCK}"
WScript.Sleep 10000
i = i + 1
Wend

*************************************************************************
'Post assisted, you were looking for something else, write back
** Happy Automating**

No comments: