|
Hi All,
I need to change my current working directory during the
execution of my application. I have attempted to do this using the following
code:
Java.util.Properties systemProperties =
System.getProperties();
systemProperties.put("user.dir",
"c:\\firstlevel\\secondlevel\\targetdirectory");
System.setProperties(systemProperties);
However, this doesn't appear to work! When I debug the program
it appears to change the directory ( I determined this by printing the property
"user.dir") but my application couldn't find the required files.
Am I doing this right or is there a more standard method of
achieving this? Would the following code work?
Runtime.getRunTime().exec("CD
c:\firstlevel\secondlevel\targetdirectory");
Thanks for any help given.
Regards Martyn Oswin
|
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.