• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Runtime exec on different windows platforms

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a problem with running a batch file from the runtime exec command. Its working fine in my XP environment, but when running on server 2008 nothing happens.
My code is as follows:-



The streamgobbler class consumes the input but also logs what has happened. This code is as follows:-



My streamgobbler is outputting the command fine, but not running in Server 2008 environment. I can run the batch file manually from a command window fine.

Any help much appreciated.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would not use readLine() in StreamGobbler because it won't return if it doesn't see a line end character. I can think of plenty of ways this might never happen.

I always just read and immediately write character by character.

Bill
 
Fyl Gurney
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, that worked a treat. Seems 2008 and XP return different stream values.
reply
    Bookmark Topic Watch Topic
  • New Topic