java - How to run a shell command in a different working directory -
my program runs in directory in c: drive, need run shell commands in directory in drive d, example. how can this:
processbuilder builder = new processbuilder( "cmd.exe", "/c", "cd \"d:\\\" && dir");
to change working directory of process, call directory()
on builder
before starting it.
wiki
Comments
Post a Comment