Thursday, June 2, 2011

Take admin ownership

C:\>takeown /f . /a /r

This will assign ownership of the current directory, and all files and folders below it, to the local admins group (BUILTIN\Administrators). Ten minutes ago, I didn't know the takeown command existed! (It's new to Vista/Server 2008)

The /f switch specifies which file(s) (single dot means current dir), the /a assigns ownership to the admins group instead of specifying a specific user, and the /r recurses through all files/folders.

No comments:

Post a Comment