Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling batch file from Java

807591Jun 10 2008 — edited Jun 11 2008
I have an app that uses the Runtime class to execute a batch file in Windows. This is a batch file that runs perfectly when I execute it from the command line. When run from my Java app, however, it runs the first part of the batch file without a hitch, then abruptly stops processing when it reaches the following line:
for %%X in (*.png) do rundll32.exe c:\windows\system32\\shimgvw.dll,ImageView_PrintTo /pt "c:\eclipse\workspace\station1\%%X" "\\myprintserver\printer1"
All of the commands before that line are executed, but neither that line nor any of the commands after it are.

Is there something special about the Java environment that would prevent this command from executing properly?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 9 2008
Added on Jun 10 2008
5 comments
209 views