Take ownership on all folders/subfolders and files

Posted on 2011-10-23
Last Modified: 2012-06-27
Dear experts,

is there any possibility to change the "owner" for all folders/subfolders and files from text file using script with combination of takeown.exe with logging please?
The script reads a text file and it changes the owerships for all folders - subfolders and files for each specific folders.

Thanks in advance,

Question by:DigitBoy
    LVL 13

    Accepted Solution

    Hi, You can try next in POwerShell while you are in C:\Windows\system32 folder

    Get-Content c:\files.txt | ForEach-Object { .\takeown.exe /f "$_" /A /R } | Tee-Object -FilePath c:\files_log.txt

    Author Closing Comment

    Thanks a lot it worked great :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How does your email signature look on mobiles?

    Do your employees use mobile devices to reply to emails? With mobile becoming increasingly important to the business world, it is in your best interest to make sure that your email signature looks great across all types of devices.

    Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
    Set OWA language and time zone in Exchange for individuals, all users or per database.
    To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
    This tutorial will show how to inventory, catalog, and restore media from legacy versions of Backup Exec into both 2012 and 2014 versions of the software. Select Storage from the tabs along the ribbon bar as the top: Ensure the proper storage devi…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now