What directories can an application run by non-elevated user write to Win7?

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

What directories can an application run by non-elevated user write to Win7?

I have a problem with my application reading and writing to any other than the User directory (C:\\Users\\MyName\\AppData\\MyCompany\\MyAppName - in Win7). What other directories are open to the non-elevated user? I have googled this issue and have come up with volumes of blah, blah, stuff but no clear cut answer. I do not wish to programatically alter the security of any file or folder nor in any way change the target machine OS or file system. I have tried C:\\Users\\..\\AppData\\Local\\.. , C:\\Users\\..\\AppData\\LocalLow\\.., C:\\Users\\AppData\\.. , but none allow non-elevated user to write to these dirs. With elevated users I can write to C:\\Windows\\system32\\.. and lots of other dirs, but that doesnt help me.

Re: What directories can an application run by non-elevated user write to Win7?

Thankyou.

Igor,
On my Win7 machine, as a non-elevated user, the following directories appear to be read/write accessible by your program.
C:\ProgramData
C:\Users\MPLIAM\AppData\Local\Temp
C:\Users\MPLIAM\AppData\Roaming
C:\Users\MPLIAM
C:\Users\Public

However, the C:\ProgramData turns out not to be writable whereas all the others listed work as expected. I do not understand this. Nevertheless, your program and your suggestion is extremely helpful.

Re: What directories can an application run by non-elevated user write to Win7?

Yes, I found that myself. And my conclusion is that something wrong with the SHCreateDirectory call, as it does not create the target path but reports success. Or there's something I still don't know about this particular issue with %ProgramData%.

Re: What directories can an application run by non-elevated user write to Win7?

the ProgramData folder might be virtualised, so creating a file "there" might actually be creating it elsewhere and the OS merely displaying them as a unity.

ProgramData might be used differently for a roaming profile.

As said before... don't look for specific folder names. they may not work. or may be differnet on a different version of windows or on a different language of windows.
use the CSLID's or the environment settings to query the actual paths.

Use the right folder for the right kind of data by default, if they user insists on writing elsewhere, that's their problem to make sure they have access.

if you''re saving a document, then the documents folder is the right default location.
if you're saving program settings, look for the registry as an initial location.
if you need to store large volumes of data. then ProgramData is the way to go.
etc. use the right location rather than looking for a location and then just dumping "anything" in there.

Re: What directories can an application run by non-elevated user write to Win7?

Once again, the problem lies with my inept programming. ProgramData is actually accessible - I had just misstyped the path by leaving out a single backslash. Sorry for the confusion. Thanks for your input.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.