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.

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
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

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.