Applications should not write to the "Program Files" location at run time: this is blocked by Windows 7. You have a couple of options depending on what the intended use of the file is, its permanence, and how easy you want it to be found by your users. Use QDesktopServices to locate the user's documents directory or the application data/cache directory. You could also write to the system temporary directory (QTemporaryFile).
MSDN has a whole bunch of guidance on this if you want to go Windows-specific.
Bookmarks