import java.io.IOException;
public class AutoStart {
public static void changeStart(boolean isStartAtLogon) throws IOException {
String regKey = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
String myAppName = "mytest";
String exePath = "\"d:\\我的文档\\桌面\\华容道(横刀立马图解).ppt\"";
Runtime.getRuntime().exec("reg " + (isStartAtLogon ? "add " : "delete ") + regKey + " /v " + myAppName
+ (isStartAtLogon ? " /t reg_sz /d " + exePath : " /f"));
}
public static void main(String[] args) throws IOException {
try {
changeStart(false);
} catch (IOException e) {
// changeStart(false);
e.printStackTrace();
}
}
}