Pass the directory when you create the file... like "C:\\Documents and settings\\the.txt" to either the constructor or the call to open().

Nothing Windows specific about this question... fstream is C++, post (next time) in C++.