I want to make a file though the cmd in java using this code
Runtime.getRuntime().exec(\"mkdir C:\\\\Users\\\\Nick\\\\test\");
and i ge
mkdir
isn't a standalone executable you can launch as a separate process - it's a command that the Windows command shell understands.
So you could run cmd.exe /c mkdir ...
:
Runtime.getRuntime().exec("cmd.exe /c mkdir c:\\Users\\Nick\\test");
Or:
Runtime.getRuntime().exec(
new String[] { "cmd.exe", "/c" "mkdir" "c:\\Users\\Nick\\test"});
... but I'd still recommend just using File.mkdir instead... why call out to an external process when you can do it within Java? (If you're going to specify an odd requirement, it helps to give some more context on it...)