How to regain control of the external hard drive in windows

permissionswindows 8

My computer came with a 1TB HDD. I took this out, and put in a new hard drive. Rather than wipe the external HDD, I moved everything that would have been C:\ to a folder (old_windows).

I bought an enclosure and I am now using the HDD as an external hard drive. Which is fine, except for one thing: I can't copy/paste files into the root of the drive. I don't have permissions.

if I mkdir on H:\ (the root of the drive) in powershell it works. If I attempt to copy something from another place (literally any place) I get:

cp : A required privilege is not held by the client.

I don't get this error if I try to copy something from another place to a folder on the drive so

cp ~\Desktop\test.txt H:\test\

Will work fine.

If I run the powershell instance as administrator it works fine. What gives? How do I fix it? If this were a linux system I'd just chown the whole thing, I'm a bit out of my element with windows.

Best Answer

Source Take Ownership of a File, Folder, Drive, or Registry Key in Windows 8:

Warning: DO NOT take ownership of the Windows 8 C: drive.

Doing so, could result in Windows 8 becoming very unstable.


Take Ownership of an Object using TAKEOWN Command

This command will take ownership of the folder or drive, and all files and subfolders in the folder or drive.

Open an elevated command prompt.

To grant ownership to currently logged on user:

takeown /F "full path of folder or drive" /R /D Y

To grant ownership to administrators group:

takeown /F "full path of folder or drive" /A /R /D Y

Examples:

takeown /F "F:" /A /R /D Y
takeown /F "F:\Folder" /A /R /D Y

To Take Ownership of a Folder or Drive and All Contents using ICALCS Command

Open an elevated command prompt.

To set any user as owner:

icacls "full path of folder or drive" /setowner "user name" /T /C

To set administrators group as owner:

icacls "full path of folder or drive" /setowner "Administrators" /T /C

Example:

icacls "C:\Windows\Folder" /setowner "Administrators" /T /C
Related Question