While running automation script people have tendency to leave their system and do other activity. But if no activity is performed on the system then it will get auto locked.
If user have admin rights for the system then it is not a big deal to remove auto screen lock. But in most of the IT companies user are not given Admin rights.
So what's the solution for this.
1. Assign Admin access to user.
But company won't allow to do so as it might breach companies policy.
2. Ask network person to change screen lock setting.
It will work only if user is not attached with group on which generic rule is applied. If so the network person need to change rule to avoid screen lock and the will automatically gets applied to all company users.
3. Install software on system like nosleep.exe
For installation you need to contact network person and get their permission.
4. Make script our your own.Script will call move mouse event at regular interval
Java Code:
import java.awt.*;
public class avoidscreenlock{
public static void main(String[] args) throws Exception{
Robot avoidlock = new Robot();
while(true){
avoidlock.delay(1000 * 30);
Point pt = MouseInfo.getPointerInfo().getLocation();
System.out.println(pt.toString() + "x1>>" + pt.x + " y1>>" + pt.y);
avoidlock.mouseMove(pt.x + 1, pt.y + 1);
avoidlock.mouseMove(pt.x - 1, pt.y - 1);
pt = MouseInfo.getPointerInfo().getLocation();
System.out.println(pt.toString() + "x2>>" + pt.x + " y2>>" + pt.y);
}
}
}
Executable Jar File:
https://drive.google.com/file/d/0B1oavopwPqD_VnI2bjF3eDNSNGM/view?usp=sharing
To run jar file simply double click on it.
If you want to run jar file from command prompt open folder containing jar file.
Press Shift + Right Click and select option 'Open Command Window here'.
Type following command to run the script 'java -jar ScriptToAvoidScreenLock.jar'
If user have admin rights for the system then it is not a big deal to remove auto screen lock. But in most of the IT companies user are not given Admin rights.
So what's the solution for this.
1. Assign Admin access to user.
But company won't allow to do so as it might breach companies policy.
2. Ask network person to change screen lock setting.
It will work only if user is not attached with group on which generic rule is applied. If so the network person need to change rule to avoid screen lock and the will automatically gets applied to all company users.
3. Install software on system like nosleep.exe
For installation you need to contact network person and get their permission.
4. Make script our your own.Script will call move mouse event at regular interval
Java Code:
import java.awt.*;
public class avoidscreenlock{
public static void main(String[] args) throws Exception{
Robot avoidlock = new Robot();
while(true){
avoidlock.delay(1000 * 30);
Point pt = MouseInfo.getPointerInfo().getLocation();
System.out.println(pt.toString() + "x1>>" + pt.x + " y1>>" + pt.y);
avoidlock.mouseMove(pt.x + 1, pt.y + 1);
avoidlock.mouseMove(pt.x - 1, pt.y - 1);
pt = MouseInfo.getPointerInfo().getLocation();
System.out.println(pt.toString() + "x2>>" + pt.x + " y2>>" + pt.y);
}
}
}
Executable Jar File:
https://drive.google.com/file/d/0B1oavopwPqD_VnI2bjF3eDNSNGM/view?usp=sharing
To run jar file simply double click on it.
If you want to run jar file from command prompt open folder containing jar file.
Press Shift + Right Click and select option 'Open Command Window here'.
Type following command to run the script 'java -jar ScriptToAvoidScreenLock.jar'
No comments:
Post a Comment