I need to build the following command using ProcessBuilder:
\"C:\\Program Files\\USBDeview\\USBDeview.exe\" /enable
First, you need to split up the arguments yourself - ProcessBuilder
doesn't do that for you - and second you don't need to put escaped quotes around the argument values.
ArrayList test = new ArrayList();
test.add("C:\\Program Files\\USBDeview\\USBDeview.exe");
test.add("/enable");
test.add("My USB Device");
The quotes are necessary on the command line in order to tell the cmd parser how to break up the words into arguments, but ProcessBuilder
doesn't need them because it's already been given the arguments pre-split.