java is not executing system command
问题 In the following program am giving name as "don" so the command will search activedirectory with all the names starting with don (like donald etc). But the line2 variable becomes null after the assignment from reader object and it never goes into the loop. What am i doing wrong? FYI: the command works when i give it on the command line. try { Process p = Runtime.getRuntime().exec( "dsquery user -name " + name + "* -limit 200|dsget user -samid -display"); p.waitFor(); BufferedReader reader =