0

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?

1 Answers1

0

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.

Evan Anderson
  • 142,379
  • 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". –  Aug 29 '09 at 06:38