Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This may be more of a programming question, however, it also involves configuration, is there a way to easily, from within a script, or program determine if the current user's profile is roaming or mandatory?

More specifically is there a way to make a best programmatic guess as to weather %APPDATA% will be deleted when the user logs off?

share|improve this question

Contrary to popular belief mandatory profiles are not deleted when the user logs off. For details see my blog article.

If you want to check whether the user's profile is mandatory check for %userprofile%\ If that does not exist, the profile is not mandatory.

If you want to know whether %appdata% will be deleted at logoff you need to check the state of the group policy setting "Delete cached copies of roaming profiles". You can do that by reading the registry value HKLM\Software\Policies\Microsoft\Windows\System!DeleteRoamingCache.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.