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?

1 Answer 1


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%\ntuser.man. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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