Application Cannot Save Files in Vista

L

Larry Stinson

I have an application that needs to save some of its data in a file. The
application is installed into the c:\Program Files\Commission Calculator
folder. The application wants to store its data in that same folder.

With all previous versions of Windows this worked fine, but with Vista it
causes a "Can't Save" error (80030103). The file extension is .adtg, but I
suspect it's the folder and/or its related privileges that is preventing the
save operation.

Should I be using a different folder to store these, or does the user need
to change his settings in Vista?

Any information will be greatly appreciated.
 
D

Dave Johnson [MSFT]

Programs should not save data to the Program Files folder, and in Vista,
Windows specifically prohibits this behavior. If you can specify a different
save path for your program, you should do so, or else check with the
developer to see if they have an update of the program that is better
behaved and doesn't save data there. I hope that helps!
 
R

Ronnie Vernon MVP

Larry

As Dave said, the %systemroot%\Program Files is a restricted area in Vista.
If you have the option in that application to change the path for the
storage of this information, creat a folder somewhere in the
C:\Users\Username folder. A good location is the
C:\Users\Username\AppData\Local\VirtualStore\Program Files, folder. This is
the location where non-Vista compliant applications should be saving their
configuration and other writeable files.
 
J

Jimmy Brush

Ronnie said:
Larry

As Dave said, the %systemroot%\Program Files is a restricted area in
Vista. If you have the option in that application to change the path for
the storage of this information, creat a folder somewhere in the
C:\Users\Username folder. A good location is the
C:\Users\Username\AppData\Local\VirtualStore\Program Files, folder. This
is the location where non-Vista compliant applications should be saving
their configuration and other writeable files.

I would warn against saving data directly to the Virtual Store.

If you are a developer for the application, then I would suggest using
the appropriate system folder for what you are storing, as determined by
the SHGetFolderPath and related API's.

http://msdn2.microsoft.com/en-us/library/aa969404.aspx
 
L

Larry Stinson

Thanks, Dave. Can you direct me to any guidelines indicating which folders
developers can use in Vista that are not restricted?

Larry
 
L

Larry Stinson

Thanks, Ronnie!! That's a huge help.

Ronnie Vernon MVP said:
Larry

As Dave said, the %systemroot%\Program Files is a restricted area in
Vista. If you have the option in that application to change the path for
the storage of this information, creat a folder somewhere in the
C:\Users\Username folder. A good location is the
C:\Users\Username\AppData\Local\VirtualStore\Program Files, folder. This
is the location where non-Vista compliant applications should be saving
their configuration and other writeable files.

--

Ronnie Vernon
Microsoft MVP
Windows Shell/User
 
L

Larry Stinson

Thanks, Jimmy!! I'll read this article in detail and change my application
accordingly.
 
G

Guest

I have my app data saved in the C:\DATA\ and I also do not have privlages to
save the files. these values are not in the restricted folder?
 
J

Jimmy Brush

Chris said:
I have my app data saved in the C:\DATA\ and I also do not have privlages to
save the files. these values are not in the restricted folder?

Hello,

In Vista, programs generally cannot save data outside of the user
profile folder (c:\users\username\)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top