• Subject: Changing the current working directory
  • From: "Martyn Oswin" <MartynOswin@xxxxxxxxxxxxxx>
  • Date: Wed, 26 Jul 2000 10:54:42 +0100

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
 
Business: 0115 9230140
Mobile   :  0378 833290
E_Mail   :  MartynOswin@CompuServe.Com

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.