Sign in to follow this  
Followers 0
Scoon

Keep script running while workstation is locked

5 posts in this topic

Hi,

I have created a simple script as my workplace pc's have been set to disable the secondary monitor after a period of inactivity, which causes the user to reboot in order to turn it back on. We have contacted IT and apparently it is a hardware feature. So the only way I have been able to stop this from happening is to create a simple Autoit script to keep the mouse moving randomly across both screens while the user is away from the pc.

The trouble is however, that I have tested it on my work PC today and it stops working when the workstation is locked (which is a requirement when we are away at lunch).

I have lodged an inquiry to the IT helpdesk to see if they can help, but in the meantime I thought I would check on the off chance that there was anything I could add to the sript that would keep it running while the workstation is locked.

- - - - - - - - - - - - - - - -

#include <GUIConstantsEx.au3>

Opt("GUIOnEventMode", 1) ; Change to OnEvent mode

$mainwindow = GUICreate("Keepawake", 200, 100)

GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")

GUICtrlCreateLabel("Click OK to exit", 30, 10)

$okbutton = GUICtrlCreateButton("OK", 70, 50, 60)

GUICtrlSetOnEvent($okbutton, "OKButton")

GUISetState(@SW_SHOW)

While 1

$scr1x=Random(0, 1024, 1)

$y1=Random(0, 768, 1)

$scr2x=Random(1025, 2050, 1)

$y2=Random(0, 768, 1)

MouseMove($scr1x, $y1)

Sleep(5000)

MouseMove($scr2x, $y2)

Sleep(5000)

WEnd

Func OKButton()

;Note: at this point @GUI_CTRLID would equal $okbutton,

;and @GUI_WINHANDLE would equal $mainwindow

Exit

EndFunc

Func CLOSEClicked()

;Note: at this point @GUI_CTRLID would equal $GUI_EVENT_CLOSE,

;and @GUI_WINHANDLE would equal $mainwindow

Exit

EndFunc

- - - - - - - - - - - - - - -

Share this post


Link to post
Share on other sites



Why is it that on every single forum there is at least one person who welcomes new members with unwarranted sarcasm?

We already have programs installed on our PCs which are happy to run in the background while the workstation is locked.

If you can't add anything useful, keep it to yourself. Why do you think this area of the forum is called "general help and support"?

Welcome to the forum.

How do you think, why this mode is called "Lock Workstation"?

Share this post


Link to post
Share on other sites

Yes, unfortunately there is no setting accessible through the monitor controls. We also don't have admin access to check the power settings, but I believe it is a graphics card issue anyway.

on the monitor's control panal, have you looked to see if it has a power save setting?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0