import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Timer;
import java.util.TimerTask;
public class MyTimer {
public static void main(String[] args) {
Timer t = new Timer();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
TimerTask timerTask= new TimerTask() {
@Override
public void run() {
try {
// Runtime.getRuntime().exec("notepad.exe d:/dd.txt");
Runtime.getRuntime().exec("cmd /k start C:\\Users\\lenovo\\Desktop\\tesst.bat");
} catch (IOException e) {
e.printStackTrace();
}
t.cancel();
}
};
try {
t.schedule(timerTask, sdf.parse("2017-10-29 8:36:00"));
} catch (ParseException e) {
e.printStackTrace();
}
}
}