Hi, Sorry for late reply. I found that there is a class called DirectorySecurity. I think this is what you need. http://msdn2.microsoft.com/en-US/library/system.security.accesscontrol.directorysecurity.aspx You might know this, But this is just to remind that Demand() method just to perform Stack walk. That is used just to prevent the Elevation of Priviledge. When your method call some function in some other dll. So, That DLL may check your DLL by creating a instance of requested permission and compare it agaist all the methods in the call stack. According to MSDN, If the Parent Directory is Readonly then when you try to create a directory in that it will give an exception. Here are the more cases when Exception is thrown. Just check if your directory is readonly?? I've played a lot with policy files, Because I am studying .NET security course at my school. And I suggest you can do the same if you want. But, Instead you can create a new permission file under user group and do not assign any permission to it except execution. Now you can create a code group and assign this permission only as a permission set. You also need to select two checkboxes from General tab. This will prevent any access to be given to the All_Code when this condition is met. Otherwise, Permission will be granted based on Union of all code groups at each policy level + intersection of all policy level.