## Taking Ownership of a File or Folder from the Command Line

Windows based issues resolved
RescuePC
Posts: 117
Joined: Wed Apr 04, 2012 8:48 pm

### Taking Ownership of a File or Folder from the Command Line

Taking Ownership of a File or Folder from the Command Line, then add group users to all files

To take ownership of a file, run the command:

takeown /F <filename>
In this command, you must replace <filename> with the full file system path to the file you want to take ownership of or relative path .\filename. If the command is successful, you'll see a message similar to the following: SUCCESS: The file (or folder): "filename" now owned by user "Computer Name\User name".

To take ownership of a folder, use the command:

takeown /f <foldername> /r /d y

To get a detailed overview of the Takeown command syntax, run the command:

takeown /?

then add user to all files

icacls .\* /q /c /t /grant Users:F