current user
-
Hi, I have created a system level service which needs APPDATA folder path which is different for each user. Is there anyway through which I can get the logged in user APPDATA folder path?
It is possible to get the name of logged in users from a service (you have already asked that and got an answer). Using that you can guess the the user directory path and verify it by checking if the pathe exists. But a service should not modify user data and usually does not need to read user data. You have not told us why you need access to user directories. Maybe there is a better solution for your problem.
-
Hi, I have created a system level service which needs APPDATA folder path which is different for each user. Is there anyway through which I can get the logged in user APPDATA folder path?
Just a guess, since I never did it yet: - enumerate currently logged i user using NetUserEnum or/and NetWkstaUserEnum functions to get the SID for every user; - use these SIDs to get info for every user from registry (HKEY_USERS\\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders) - ... Hope, it helps (at least to move you in some potentially useful direction).
-
Hi, I have created a system level service which needs APPDATA folder path which is different for each user. Is there anyway through which I can get the logged in user APPDATA folder path?
-
Hi, I have created a system level service which needs APPDATA folder path which is different for each user. Is there anyway through which I can get the logged in user APPDATA folder path?
john5632 wrote:
Is there anyway through which I can get the logged in user...
Multiple users can be logged in at once.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
There is an environment variable named 'APPDATA' which has a full path. You can get any environment variable. So would that not be sufficient?