Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How to define the Application.LocalUserAppDataPath for windows services?

Serive Account type as "LocalSystem".

its referring the following path C:\Documents and Settings\LocalService\Application Data

but, it required to use the following path, C:\Documents and Settings\All Users\Application Data\

Is there any configuration required setup the service?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

The "NT AUTHORTY\SYSTEM" user (also known as "LocalSystem") has a user registry hive just like any other user. It's exposed for you to get at as HKEY_USERS.DEFAULT (and it has nothing to do with the "Default User" profile-- the ".DEFAULT" was just an unfortunate name choice).

I suppose you could change the shell folder location for its AppData folder here:

HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

I'm not sure what the unintended consequences of such a change might be, and I'm doubtful you'll find any Microsoft docs that will tell you. Good luck. If it breaks you get to keep all the pieces.

share|improve this answer
    
Thanks alot Evan!! Could you tell me, why "Application.LocalUserAppDataPath" is differ from "Application.CommonAppDataPath" for a same windows service? The "Application.LocalUserAppDataPath" suppose to refer the same path as "Application.CommonAppDataPath". –  Selva Aug 29 '09 at 6:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.