• Post Reply Bookmark Topic Watch Topic
  • New Topic

winbatch script  RSS feed

 
madhuri akhi
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
java is supported winbatch files or not?if it is write
where do we write the code in our application?
how can we run the application in jvm?
 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You say what???

Are you asking if Java supports executing Windows batch scripts?

If so! Yes, on a Windows machine of course
You can use the java.lang.Runtime class to execute Windows batch commands. eg. Runtime.getRuntime().exec("dir");

Hope this answers your question!
[ September 22, 2006: Message edited by: Manuel Moons ]
 
Joe Ess
Bartender
Posts: 9441
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This command won't work:

"dir" is not executable. It's a command passed to the Windows command processor (CMD.EXE or COMMAND.COM). Have a look at When Runtime.exec Won't for more about exec().
 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ha, ok, so dir won't work. It was just the first command that came to mind.

Sorry, bad example but you get the point...
 
madhuri akhi
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
moons give me clear idea about win batch script execution plzzzzzzzzz
 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you should give us a clear idea on what you are trying to do?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!