Access to AppData on Vista?

J

Joe Cool

I bought a new computer last summer and it is running Vista Home
Premium 64bit. I have a few apps I wrote for personal use that are
system tray apps and store their configuration XML files in the
AppData folder. These programs have access to create and update those
files just fine. However, if I try to copy that XML file (in order to
make a backup copy) with an app using File.Copy or in a BAT file using
xcopy, Vista tells me I do not have access to the file. Vista never
even asks me to grant access. I was able to do this just fine with XP
Pro. Is there some way to tell Vista to let me copy that file
somewhere?
 
P

Peter Duniho

Joe said:
I bought a new computer last summer and it is running Vista Home
Premium 64bit. I have a few apps I wrote for personal use that are
system tray apps and store their configuration XML files in the
AppData folder. These programs have access to create and update those
files just fine. However, if I try to copy that XML file (in order to
make a backup copy) with an app using File.Copy or in a BAT file using
xcopy, Vista tells me I do not have access to the file. Vista never
even asks me to grant access. I was able to do this just fine with XP
Pro. Is there some way to tell Vista to let me copy that file
somewhere?

This is not much of a C# question. You will get better advice posting
elsewhere.

That said, the layout of user files on Vista and Windows 7 (if you
bought your computer after July 20, you should be able to get a free
upgrade to Windows 7) is somewhat different from XP. You should start
by verifying that the file you are trying to copy programmatically is in
fact in the place where you think it is.

Pete
 
J

Joe Cool

This is not much of a C# question.  You will get better advice posting
elsewhere.

That said, the layout of user files on Vista and Windows 7 (if you
bought your computer after July 20, you should be able to get a free
upgrade to Windows 7) is somewhat different from XP.  You should start
by verifying that the file you are trying to copy programmatically is in
fact in the place where you think it is.

I am aware that the location of the AppData folder is now different
from XP. And I verified the file is in that location with a command
prompt window. I think it is a problem with user access, even though
this is a single user computer for home use where I am the one and
only user and I am the computer's administrator. I thought since a
C#.NET app had access to create the file and update it, another app
should be able to copy it, but appearently, File.Copy access and
command prompt copy command access somehow work differently than a
compiled .NET app. I was hoping some other developer had run into this
already and hopefully solved it. I did a Google search and found a few
posts on other support sites from users who had a very similar
problem, but none of the sites actually provided an answer.

What is really strange is that while I cannot access the file in a
command prompt window with the copy command I can type out the
contents with the type command!!
 
P

Peter Duniho

Joe said:
[...] I thought since a
C#.NET app had access to create the file and update it, another app
should be able to copy it, but appearently, File.Copy access and
command prompt copy command access somehow work differently than a
compiled .NET app. [...]

How are you using "File.Copy" not in "a compiled .NET app"?

In general, there should be no difference between programmatic access
and command line access, provided the same user credentials are used for
each.

That you are (apparently) seeing a difference suggests a configuration
problem.

If you can post a concise-but-complete code example that reliably
reproduces the problem, you are sure to find one or more people at least
willing to try to reproduce the problem and see if there's something in
the code that's causing a problem.

Otherwise, I think the advice you can receive in this particular
newsgroup will be limited.

Pete
 

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