Monday, December 13, 2010

bench3

How To Take OwnerShip Of Files Using Command Prompt

This article describes how to take ownership of a file or a folder to which you are denied access.
Applies To:
  • Windows Vista
  • Windows 7
  • Windows Server 2008
If you must access a file or a folder that you do not have rights to, you must take ownership of that file or folder. When you do this, you replace the security permissions that were originally created for the file or folder.

You must be either logged on to Windows as an administrator or you should have access to administrator password for the computer for which you are going to use these steps in order to change security permissions for a file or a folder.

If the computer is your personal computer, you are likely already logged on with an administrator account. If the computer is part of a network at work, you might have to ask the system administrator for help. To verify that you are logged on to Windows with a user account that is a computer administrator, visit the following Microsoft Web site:

Open an elevated command prompt. To do this, click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.


If you are prompted for an administrator password or for a confirmation, type the password, or click Allow.


At an elevated command prompt, type the following command, and then press ENTER: takeown /f Path_And_File_Name
For example, type takeown /f E:\windows\system32\jscript.dll.
Type the following command, and then press ENTER to grant administrators full access to the file:
icacls Path_And_File_Name /GRANT ADMINISTRATORS:F
For example, type icacls E:\windows\system32\jscript.dll /grant administrators:F.
Type the following command to replace the file with a known good copy of the file: 
Copy Path_And_File_Name_Of_Source_File Path_And_File_Name_Of_Destination
For example, type copy E:\temp\jscript.dll E:\windows\system32\jscript.dll.

bench3

About bench3 -

Haja Peer Mohamed H, Software Engineer by profession, Author, Founder and CEO of "bench3" you can connect with me on Twitter , Facebook and also onGoogle+

Subscribe to this Blog via Email :