Windows server 2003/2008 and Vista – How to take ownership of files and folders via command line

Posted by Erica | Posted in Windows 2003, Windows Vista | Posted on 30-06-2009

1




Do you know that Windows server 2003 and Windows Vista include command line tool called “takeown” that lets you take ownership of files and folders?

Takeown tool basic syntax is:

takeown /f <file or folder name>

For example to take ownership of file secret.doc which resides in C:\Docs\ open command line and type:

takeown /f C:\Docs\secret.doc

takeown1

Thus, if you want to take ownership of a folder named C:\Docs, as well as any files and folders inside C:\Docs, you`ll type:

takeown /f C:\Docs /r

takeown2

One more tip… if you want to avoid Windows asking you questions like “Do you really want to do that?”… add one more key:

takeown /f C:\Docs /r /d y

takeown3

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Reddit
  • StumbleUpon
  • Blogosphere News


Follow us on Twitter !
Follow us on Twitter!


Comments posted (1)

Would be useful if this command is available in Windows 7.This process is quite faster than taking ownership through properties dialog box

Write a comment