Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

running java code using batch on locked system

$
0
0
Hi
i am working on some automation. i am using batch file to start a process then i need to send some keystrokes, doing this using java
package pack;

import java.awt.MouseInfo;
import java.awt.Robot;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;

public class FTR {

                
                public static void main(String[] args) throws Exception {
                                
                                Thread.sleep(5000);
                                
                                Robot r = new Robot();
                                r.keyPress(KeyEvent.VK_ENTER);
                                r.keyRelease(KeyEvent.VK_ENTER);




created jar then called using batch file. attached this to scheduler
Now it works fine if the system is unlocked, but when locked during the run i found system as it is before pressing this enter. what could be the problem & solution?
do i need to send ctrl+alt+del then password to unlock it before sending this enter?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>