I want to invoke a Windows command from Java.
Using the following line works fine:
ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/C",
"find \"searchstr\" C://Workspace//inputFile.txt");
But I want to find the string in all text files under that location, tried it this way,
ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/C",
"find \"searchstr\" C://Workspace//*.txt");
But it does not work and there is no output in the Java console.
What's the solution?