Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

IOException: CreateProcess: cmd.exe /c copy /B...  RSS feed

 
Micha Jones
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Report post to moderator
Advice grately appreciated:
I can't for the life of me figure out why this doesn't work. From the command line, this works:
copy /B test.txt \\Hq2oakps2\p4103hp5k
And consulting this thread:
http://jguru.com/forums/view.jsp?EID=476993
I wrote this code:
Process printJobProcess = null;
String printCommand = "cmd.exe /c copy /B " + tempPCLFile.getPath() + " \\\\Hq2oakps2\\p4103hp5k";
printJobProcess = Runtime.getRuntime().exec(printCommand);
printJobProcess.waitFor();
Which attempts to create this command:
cmd.exe /c copy /B C:\WINDOWS\TEMP\invoice-CAET20601B12946.pcl \\Hq2oakps2\p4103hp5k
But results in this error (I am -shamefully- having to work in Win98 at current; could that be an issue?):
java.io.IOException: CreateProcess: cmd.exe /c copy /B C:\WINDOWS\TEMP\invoice-CAET20601B12946.pcl \\Hq2oakps2\p4103hp5k error=0
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at com.apl.ppdi.appl.form.InvoicePrinter.printPCL(InvoicePrinter.java:214)
Advice grately appreciated
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post the same message in more than one forum. You obviously read several forums, so do the people who might answer your question.
This thread is now closed. All replies to the one in "Java in General (intermediate)" please.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!