Reputation: 21
I developed an application for my diploma, and at some point i have to run a batch file from a java source file. The problem is that every time i try to execute that batch file i get this error: "Not enough storage is available to process this command".
This batch file just runs cvs log command. If i run the command directly from cmd, everything goes fine, but if i try to run the batch file which contains this command, i get that error :(
I use this example, for running a batch file:
// --------------
Process process = Runtime.getRuntime().exec(cmd);
process.waitFor();
// --------------
Where, cmd is a string like this: "cmd /c start \"\" absolute_path_of_batch_file".
Does anyone knows how can i solve this problem? And what it is exactly this error? Thank you!
Upvotes: 2
Views: 2287
Reputation: 30032
Running from java will run the command in its own process so it should be exactly as if you ran the command from the command line. What may be different is the directory you are running the batch file from (or environment variables). Are there any relative paths in the batch file?
Otherwise, do a sysout
on that cmd
string and execute exactly that string in the cmd
terminal and see if it works. And also post the exact error.
Upvotes: 1