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
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
Ron McLeod
Paul Clapham
Devaka Cooray
Tim Cooke
Sheriffs:
Rob Spoor
Liutauras Vilda
paul wheaton
Saloon Keepers:
Tim Holloway
Tim Moores
Mikalai Zaikin
Carey Brown
Piet Souris
Bartenders:
Stephan van Hulst
Forum:
Java in General
Runtime.getRuntime().exec doesnt execute some files
garfild Baram
Ranch Hand
Posts: 60
posted 18 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 18 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: 23956
142
I like...
posted 18 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: 23956
142
I like...
posted 18 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)
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
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...