Saving console output to string in javascript : Is there a way to save the output from my code that pulls up netstat through the command line into a string so I can use a printline for it? So that when I run it through np++ I can see the output there instead of through the command line?

    class Netstat
    {
    public static void main(String[] args)
    {
        try
        { 
         Runtime.getRuntime().exec("cmd /c start cmd.exe /K \"netstat\"");
        }
        catch (Exception e)
        {
            System.out.println("Something went wrong.");
            e.printStackTrace();
        }
    }
    }
    
                  