Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
High Performance Python for Data Analytics
this week in the
Python
forum!
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
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Bear Bibeault
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
Tim Cooke
Junilu Lacar
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Jj Roberts
Carey Brown
Bartenders:
salvin francis
Frits Walraven
Piet Souris
Forum:
Java in General
Runtime.getRuntime().exec doesnt execute some files
garfild Baram
Ranch Hand
Posts: 60
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi helper,
I use in my code:
Process p = Runtime.getRuntime().exec(scriptToRun);
and it runs file1.cmd that containes the following:
file1.cmd:
set ADVANTAG_FOLDER=c:\Yoss_test
RD /s /q %ADVANTAG_FOLDER%
but it doesnt run file2.cmd :-(
file2.cmd:
echo "after File " >> after.txt
Do you have a clue why file1 is executed and file2 is not. I dont get any errors at all.
Thanks
Yossi
garfild Baram
Ranch Hand
Posts: 60
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
sorry for the trubles....
All files are executed ,I just looked for the results in the wrong place.
All good
Thanks
Yossi
Henry Wong
author
Posts: 23893
142
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Are you sure it is not running? Or are you just having problems finding the "after.txt" file?
I would suggest that either you use the version of exec() that sets the working directory, or scan your disk to see where this file is.
Henry
Books:
Java Threads, 3rd Edition
,
Jini in a Nutshell
, and
Java Gems (contributor)
Henry Wong
author
Posts: 23893
142
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Glad to see that you solved it on your own...
Books:
Java Threads, 3rd Edition
,
Jini in a Nutshell
, and
Java Gems (contributor)
Get off me! Here, read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Launching files programatically
tricky question
dos commands within java program???
open a file located on server
Running a program from a Java Application
More...