Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Friday, December 2, 2011

Ownership in Windows 2003, Part II

As administrator take ownership of the complete foldertree first. 
Start -execute
cmd
(Run As Administrator)
- Change location to the folder you need access to
e.g.:
E:
cd e:\OSL
- Type: takeown /F . /R /A /D Y > NUL
- Type: icacls . /grant Administrator:(OI)(CI)(F) /T /Q
- Type: icacls . /grant oscar:(OI)(CI)(F) /T /Q

Afterwards you will be able to change the access rights using cacls or xcacls.
http://programmerstools.hubpages.com/hub/xcacls
===========================
Unix/linux correspondance to windows
chmod is used to change access rights on files and folders for owner-group-others.
So chmod would correspond more to cacls.
And chown would correspond to takeown
===========================
CACLS for windows XP
Elevation of privilege per script
Ownership of a file or folder
Denied permission to access folders
- click Start
- Type: cmd
- Right-click cmd when it appears
- Click Run As Administrator
- Change location to the folder you need access to (e.g. cd e:\folder)
- Type: takeown /F . /R /A /D Y > NUL
- Type: icacls . /grant Administrator:(OI)(CI)(F) /L /T /Q
(in other case use instead of Administrator your username - you will only have access from your
XP and Vista machine in this case)
[> is the character greater than without the ; character]
[It should be ""USER : ( O I )..." but without the spaces before and after : ]
(Or, replace USER (Administrator) with Users if you want anyone [on any computer
your hard drive is plugged into] to have full access to these files)
---------------------
other version:
I restored the primary [C:] hard drive from an old computer running Windows XP to a new one as a secondary/additional hard drive on Windows Vista, and got a "You have been denied permission to access this folder" message.
Found this page via Google. Thank you, Jimmy Brush.
Code:
  1. Click Start
  2. Type: cmd
  3. Right-click cmd when it appears and select Run As Administrator.
  4. Change location to the folder you need access to (e.g. cd e:\folder).
  5. Type: takeown /F . /R /A /D Y > NUL
  6. Press the Enter key and wait for the command to complete.
  7. Type: icacls . /grant users:(OI)(CI)(F) /L /T /Q
  8. Press the Enter key.
iCacls sintax
iCACLS.exe (2003 sp2, Vista)
======================
CACLS: Capacidades de permisos de grupo

No comments: