This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Problem in saving File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Problem in saving File" Watch "Problem in saving File" New topic

Problem in saving File

Ankur Pandya

Joined: May 28, 2009
Posts: 3
Hello Sir,
I am developing a desktop application in JAVA - Swing.
For this app I have to store username and password in a textfile in order to login automaticaly at next start.
Now, I want to save this file in System32 folder in Windows, than which path should I write..??
Right now I m using C://windows//system32 path, but it is static and creates problem when windows is installed in d: or anywhere else..
so, which path should I use..??
Rob Spoor

Joined: Oct 27, 2005
Posts: 19655

I'd use a sub path of System.getProperty("user.home"). For me that call returns "C:\Documents and Settings\MyUserAccount", on a Linux machine it would return "/home/myuseraccount", etc.

How To Ask Questions How To Answer Questions
Ankur Pandya

Joined: May 28, 2009
Posts: 3
Thank you sir..
I agree. Here's the link:
subject: Problem in saving File
Similar Threads
Error in starting Jboss through Command Prompt
JVM crash due to perm gen space 99% in use
Configuring a SQL datasource
Setting Java Classpath in Microsoft XP OS
can't get Java to run