Java代码
Runtime.getRuntime().exec(
"del C://temp.txt");
public class CmdDelFile {
public static void main(String[] args) {
try { String[] cmdArray = {
"cmd",
"/c",
"del",
"C://Temp//temp.txt"}; Runtime.getRuntime().exec(cmdArray); }
catch (Exception e) { e.printStackTrace(); } } }