Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within I/O and Streams
Search Coderanch
Advance search
Google search
Register / Login
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
Devaka Cooray
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Jeanne Boyarsky
Tim Cooke
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Mikalai Zaikin
Carey Brown
Bartenders:
Forum:
I/O and Streams
can we run a Batch file from our java program
karthik sreeram
Greenhorn
Posts: 9
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I want to know how to run a .bat file or .cmd file by using a
java
program,my batch file may consist of some MS DOS commands like
dir
cd c:\kkk\.........
help
javac
some more like this .........
please reply me if you know about it.
Ernest Friedman-Hill
author and iconoclast
Posts: 24204
44
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Welcome to JavaRanch!
See the family of methods named "exec()" in the java.lang.Runtime class; they allow you to run external programs from Java. You'll need to run the command shell with the batch file as an argument, like "cmd.exe /c batch.bat".
[Jess in Action]
[AskingGoodQuestions]
I do some of my very best work in water. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
call java (main) program from JSP
running bat file from java app. PLEASE HELP!!!!!
jar interdependencies
java program that can run a .class file in msdos, is this possible?
method to restart an app?
More...