is there a way to add a specific directory to the Windows systemvariable %PATH%? This doesn\'t seem to work:
String[] cmd = { \"cmd\", \"/c\", \"set\", \"PAT
This is not possible with just running a batch file. See here for details.
Your solution doesn't work, because it only modifies the environmental variable in the process level and not in system level.