args = new String[] {
"mount",
"-t",
"cifs",
"-o",
"user=root",
"-o",
"password=password",
"\\home\\sharefolder\\test",
"/home/test" }Process ps = Runtime.getRuntime().exec(args);这么执行成功不了,有高手指点一下么
"mount",
"-t",
"cifs",
"-o",
"user=root",
"-o",
"password=password",
"\\home\\sharefolder\\test",
"/home/test" }Process ps = Runtime.getRuntime().exec(args);这么执行成功不了,有高手指点一下么
有什么输出?
加上mount的完整路径试试。
"user=root",
"-o",
"password=password",
String mountCommand = ""//这里写你的命令就可以了
try {
Process p = Runtime.getRuntime().exec(mountCommand);
} catch (IOException e) {
e.printStackTrace();
}
}
}
另外楼上也说了,看看exit value。