Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to avoid system lock while running Windows Based Application
#1
Solved: 10 Years, 8 Months, 3 Weeks ago
HI All,

We have an Windows based application which we are planning to run on nightly builds, Problem is when we run the script the system gets locked for every 10 min . Is there any workaround to keep system unlocked when running windows based applications.

Regards,
SaranKumarV
Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi Saran,

Turn off the password protected screensaver if it is on and also check if there is any setting to lock the computer automatically if left idle.
Reply
#3
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi Saran,

We can handle this... not an issue.

If you're able to download "Caffeine 1.4"... It's a small software(in KB's) available on website, you can run this on system to disable the automatic locking on your system. It is freeware so you can download in your company and use, not a problem.

still if your company strictly blocks such type of softwares.

you can handle through scripting...

Develop one VBScript file to run in background.
I'm not giving exact code here, just logic
Logic is :
1.send expectation time to keep your system desktop active.
2.take present time and sent time (eg: in hrs),
3.compare both of them and enter into loop
4.make wscript to sleep for some time like (less than automatic lock time)
5.press any lockkey (numkey, scrollkey) twice

it repeats step 3... till the sent hrs completed.

once it reaches the time, it will not enter into loop to sleep and press lockkeys.

It might locks after some time.

If you're not satisfy let me know.
Reply
#4
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi Saran,

Code:
Create .vbs file with the follwing code:
    Const DELAY_MINUTES = 10

    Wscript.Sleep DELAY_MINUTES * 60000
    Do
      CreateObject("Wscript.Shell").SendKeys "+"
      Wscript.Sleep DELAY_MINUTES * 60000
    Loop
Then using this .vbs create a task in the task scheduler.

Regards,
Sudha
Reply
#5
Solved: 10 Years, 8 Months, 3 Weeks ago
Create a VBS file, Copy below code and paste it.

Code:
Const micVoid = 0
Const micByte = 26
Const micLong = 3
Const KEYEVENTF_KEYUP = &H2
Set Extern = CreateObject("Mercury.ExternObj")
extern.Declare micVoid, "keybd_event", "user32", "keybd_event", micByte, micbyte, miclong, micLong
Extern.Declare micVoid, "Sleep", "kernel32", "Sleep", micLong
While True
  extern.keybd_event 0, 0, KEYEVENTF_KEYDOWN, 0
  Extern.Sleep 20000
Wend


Save it, and double click on it, it will work
Reply
#6
Solved: 10 Years, 8 Months, 3 Weeks ago
Just Down load the Attached Zip file Extract it,
Execute the extracted VBS file into your system (VBS Execution: Double click on the VBS icon)

It will avoiding you system lock issues.

Regards,
Munna Sarfraz


Attached Files
.zip   MunnaSarfraz.zip (Size: 385 bytes / Downloads: 565)
Reply
#7
Solved: 10 Years, 8 Months, 3 Weeks ago
(12-13-2010, 10:31 AM)SaranKumarV Wrote: HI All,

 We have an Windows based application which we are planning to run on nightly builds, Problem is when we run the script the system gets locked for every 10 min . Is there any workaround to keep system unlocked when running windows based applications.

Regards,
SaranKumarV

Hi SaranKumar,

Please follow the below instructions:
  • Create a simple vbs file having code to press numlock key and run that vbs file

  • Edit one registry key “DisableLockWorkstation =1” to disable locking
    Regards,Moin
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  capturing message on web page when caps lock is on helan 0 2,088 04-29-2015, 05:25 AM
Last Post: helan
  System work slow with UFT 12.02 elyanivson 0 2,674 02-10-2015, 05:09 PM
Last Post: elyanivson
  can not record Windows application QTP 12.1 pratapchinta 1 2,084 12-01-2014, 06:30 PM
Last Post: supputuri
  UFT 12 unable to recognize the objects of a java based application (jre - 1.7.0_65) Sushant Dasgupta 2 8,949 09-17-2014, 03:47 PM
Last Post: Sushant Dasgupta
Cool ntdll.dll crash problem with UFT 11.5 Application in Windows Server 08 gangadhar 1 4,436 06-13-2014, 04:43 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)