I am writing a program in java which would execute winrar and unzip a jar file for me placed in h:\\myjar.jar into the folder h:\\new. My java code
h:\\myjar.jar
h:\\new
The complete first argument of exec is being interpreted as the executable. Use
exec
p = rt.exec(new String[] {"winrar.exe", "x", "h:\\myjar.jar", "*.*", "h:\\new" } null, dir);