Monday, October 1, 2012

How-to own any folder as admin

Doesn't it happen sometimes that you wish you had administrator rights to a folder in windows??
Or that you want to delete a file and reach a road-block realizing that maybe due to some issues during the set-up you do not have admin rights although you are actually the admin?

Well, this has happened to me once. I found a neat solution to this which works on every type of windows out there(even Windows 8, if you were curious) because it harness the way windows run .bat files.

I hope you are excited to be able to do it so lets get to it. ;)

Step 1: Locate the folder you want to own as administrator and note down its path.
Step 2: Make a delete.bat file using notepad in the folder you want to own as administrator.
Step 3: Now write the following script in that .bat file.
            SET DIRECTORY_NAME="C:\Locked Directory"
            TAKEOWN /f %DIRECTORY_NAME% /r /d y
            ICACLS %DIRECTORY_NAME% /grant administrators:F /t
            PAUSE

            You need to change "C:\Locked Directory" to "Path of your directory".

Step 4: Now run this delete.bat . A DOS screen will pop-up, some tech stuff will happen and voila, you own the folder as administrator now.

Note: DO NOT use this for illegal purposes. Its for informational purposes only.
Also some people report problems at step 4 so you may try ' Run as Administrator' to make it succesful.


Hope it helped. Cheers :)

2 comments:

  1. When i try to save the file, it says, "A required privilege is not held by the client."

    ReplyDelete
    Replies
    1. What folder are you trying to get access to??
      Because if its a drive or say a folder with many sub-folders then this process may not work. In that case, you need to take the rights step by step.

      Delete

ShareThis