Skip to content

Instantly share code, notes, and snippets.

View LearnItCodeIt's full-sized avatar

LearnItCodeIt

View GitHub Profile
@LearnItCodeIt
LearnItCodeIt / CMD.java
Created November 25, 2016 20:59
the output of this method is the same output of the command variable if you typed in cmd because it create a cmd process and input the command variable then take the output and return it
import java.io.BufferedReader;
import java.io.InputStreamReader;
class CommandPrompt {
public static void runSystemCommand(String command) {
try {
Process p = Runtime.getRuntime().exec(command);
BufferedReader inputStream = new BufferedReader(