Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


May 09, 2007

In Windows Vista, how can I take ownership of a file from the command line?

RSS
Subscribe to Windows IT Pro | See More Tips Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

A. Vista retains the Takeown command, which lets you take ownership of a file. A number of switches (e.g., /s) let you specify a remote system, along with the user context to use (e.g., /u and /p for username and password). Here's some sample usage for taking ownership of a specific file:

takeown /f intlcfg.exe
SUCCESS: The file (or folder): "D:\Temp\intlcfg.exe" now owned by user "SAVILLTECH\john"

To take ownership of a folder and all its content, you can add the /r switch for recursive execution:

takeown /f . /r
SUCCESS: The file (or folder): "D:\Temp" now owned by user "SAVILLTECH\john"
SUCCESS: The file (or folder): "D:\Temp\boot.wim" now owned by user "SAVILLTECH\john"

You can also use the /a switch to make the ownership go to the Administrators group instead of the current user:

takeown /f intlcfg.exe /a
SUCCESS: The file (or folder): "D:\Temp\intlcfg.exe" now owned by the administrators group.

End of Article



Reader Comments

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
What You Need to Know About Microsoft's x64 Server Product Plans

What do Longhorn Server, Windows Compute Cluster Server, and Windows Vista have in common? The x64 platform. ...

WinInfo Short Takes: 4th of July Special Edition

An often irreverent look at some of the week's other news, including a shortened work week thanks to the 4th of July, expensive Windows 7 pricing, Bing's modest monthly gains, IE 8 heading to work, Steve Jobs back at Apple, and so much more ...

Social War Dialing - The New Identity Theft Menace

A new method of stealing personal financial information uses VOIP to attack bank customer over the phone. ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events WinConnections and Microsoft® Exchange Connections

Take Control of Storage & eDiscovery Costs with Unified Content Archiving

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format

Test Drive IT Solutions and Get Free Music Downloads
Solve your toughest IT problems with these free downloads and receive 5 free music downloads!


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home asp.netPRO Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement | Reprints and Licensing