/*
* Resolved the error containing the space directory
Runtime.getruntime (). EXEC ("cmd/c" + "D:/1.txt");
/*
public static void Opensystemexefile () {
String strURL = "D:\t.txt";
File Crtfle = new file (strURL);
if (crtfle!= null && crtfle.exists ()) {
int index = Strurl.lastindexof (".");
String format = strurl.substring (index + 1, strurl.length ());
if (format.equals ("EXE")) {
try {
Runtime.getruntime (). exec (strURL); Execute the System EXE file
RegRead RG = Regread.getinstance ();
String filePath2 = "\" + strurl + "\";
if (RG. ShellExecute (filePath2, NULL)) {//AppName,
}
String ExePath = RG. Getonlyopentool (format);
if (ExePath = null | | exepath.equals ("")) {
Return
}
Return
catch (IOException ex) {
Ex.printstacktrace ();
}
} else {
If it is executable.
String formats = substr (strURL). toLowerCase ();
if (formats = NULL | | "". Equals (formats)) {
Return
}
if (formats.equals ("EXE")) {
try {
Runtime.getruntime (). exec (strURL);
Return
catch (IOException ex) {
Ex.printstacktrace ();
}
} else {
try {
System.out.println (strURL);
Runtime.getruntime (). EXEC ("cmd/c" + strurl);/file path, (cmd
/c is a system command)
catch (IOException e) {
E.printstacktrace ();
}
Return
}
}
}
}