Home » sysinternals

Tag: sysinternals

Taking ownership of multiple folders and files

Numerous roaming profiles without the administrator added for NTFS permissions. Access was denied for copying, moving etc.

Native tools for taking ownership of multiple folders and files for end user profiles.


Taking Ownership
TAKEOWN.exe /F <folderpath> /R /A /D Y

/F = path
/A=owner to administrators rather than logged on user
/D = default answer to setting list folder permission Options: Y or N

Set NTFS Permissions on multiple files
Set permissions instead
icacls.exe <folderpath> /grant administrators:F /T

To run this command on a range of folders get the list into a txt file with each entry on a single line and run

for /f %1 in (c:folders.txt) do takeown.exe /F %1 /R /A /D Y

Unblocking numerous files with sysinternals streams.exe

After extracting a number of files from a ZIP file windows kept track of these files as dangerous by means of the files ‘stream’ (ie tracking where the file originated from)

Typically to allow these files to execute you need to

Right click the file > properties > UNBLOCK

“This file came from another computer and might be blocked to help protect this computer”

The problem was all files were blocked. Resulting in 500 individual changes or…..

To change this (effectivly deleting the stream tracking) to remove the block for all files
Download streams.exe from SYSINTERNALS from here

and then run the following command
streams.exe -s -d %FOLDERPATH%