我想为我的软件制作一个卸载程序,我希望它只删除文件和注册表,但是,我得到了这个,我尝试添加一个空格,检查语法,但这些都不起作用,这是一些代码,错误在消息下方。
public static void main(String[] args) throws IOException {
Runtime.getRuntime().exec("DEL " + query(WinReg.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{15100000-0000-0409924A46C310}", "InstallLocation") + "\\yes i already checked the name, also i dont feel like sharing the name.");
Advapi32Util.registryDeleteKey(WinReg.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{15100000-0000-0409924A46C310}");
}
private static String query(WinReg.HKEY Hub, String loc, String Value) throws IOException {
return Advapi32Util.registryGetStringValue(Hub, loc, Value);
}
}
Exception in thread "main" java.io.IOException: Cannot run program "DEL": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at login2.s.main(s.java:10)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 5 more