• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading the output from a bat file run by Runtime.exec

 
Matthew Hersee
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am running the VSS command line from a java app.

I run the runtime.exec, this executes a bat file.

I need to read the output of the process - which is the contents of a file from VSS.

However my reader only shows me the that it has run each line from the bat file, not any of the ouput. I kept thinking i should be using the p.getOutputStream() method, but i can only write to that. I am most confused.

At present i have the following code



I am sure i am missing something obvious here.

Thanks in advance

Matt
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

This article explains some of the pitfalls of Runtime.exec; it might be of help.
 
Matthew Hersee
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the response

i looked in the errorstream and it was permissions that were stopping the final statement of my bat file from running. Hence no output

this is signed off
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!