• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Windows file system functions

Red Squirrel

No Lifer
I am looking for some functions (can be .net specific, or not, does not matter) that will allow me to perform various file system tasks that neglect the permissions, such as deleting, getting file size etc...

It's important that it ignores permissions as what I want to do is write an app to mass delete home folders based on a list, and I find with windows permissions it gets weird where even if you're the admin, you need to take ownership before being able to do anything. I want to write an app to make this process faster.

Worse case scenario if there is a way to programaticly take ownership then that will work too but if I can avoid touching the permissions then even better. I'm sure it's like that for a reason.
 
When you find such functions, please post them here so we can alert Microsoft and the media about the massive security holes that would allow programs to bypass file permissions and delete user files at will.
 
In all seriousness, you need to get a better handle on how Windows file permissions work, then identify what specific permissions your application will need. File permissions don't "get weird"; they work in a very specific and repeatable way. You need to understand that process first if you hope to work with files in some automated fashion.
 
When you find such functions, please post them here so we can alert Microsoft and the media about the massive security holes that would allow programs to bypass file permissions and delete user files at will.

lol :awe:
 
In Vista / Win7 your app may not be running with admin rights even if you are in the admin group. You may need to mark the app as requiring admin access in its manifest.
 
When you find such functions, please post them here so we can alert Microsoft and the media about the massive security holes that would allow programs to bypass file permissions and delete user files at will.

Pretty much any linux function... but booting the server with a live cd is not an option.

I am running the app with admin rights (domain admin). Windows is weird when it comes to permissions in that even if you're admin if you're not the owner or added to the permisions you have no access. This is silly, the admin should be able to access everything. I'm sure this is just something explorer does and can be done differently at a lower level through a custom app.
 
For a maintenance process like this create a user and give that user full control (or appropriate control) over the root folder of the tree you want to manage, then run the maintenance process in the context of that user. You can still have issues with files and directories being locked, but that is separate from permissions.
 
For a maintenance process like this create a user and give that user full control (or appropriate control) over the root folder of the tree you want to manage, then run the maintenance process in the context of that user. You can still have issues with files and directories being locked, but that is separate from permissions.

I thought of doing this but scared it might cause issues to make such a mass permission move. I might go ahead and just give domain admins permissions, and find out what process is removing it in first place. Hopefully that wont cause issues. VM snapshot FTW?
 
Back
Top