How would this code access all the program on the desktop?
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
public class cmd {
public static void main(String[] args) throws IOException {
String[] command = {"ls", "-al"};
String str;
Scanner scan= new Scanner(System.in);
str=scan.nextLine();
ProcessBuilder builder = new ProcessBuilder(command);
builder = builder.command(str);
Process p = builder.start();
}
}
Comments
Post a Comment