Grant access & create User on 800 files.....

Discussion in 'Windows 7' started by azert, Jan 23, 2010.

  1. azert

    azert MDL Novice

    Jan 23, 2010
    3
    0
    0
    Hi,

    I changed My OS (Currently W7) installed on a new HDD. the old one was partionned with Vista and others stuff. I did a fromat on the partition where Vista was installed and merge both partition into one unique . So now I only have ONe HDD with my files But .... ALL the files are not accessible due to the fact that the user is not the right one.

    The current user is S1-5-21-29XXXXXXXXXXXXXXXXXXXXXX-1000.

    I did a lot of tries with takeown / icacls .... USe script like takecontrolof .... nothing !

    To get access to the file i must Assign first an owner for the file then set the rights to that owner. I Have thousand files....

    If someone could help Me !!!!!
     
  2. Hazar

    Hazar MDL Guru

    Jul 29, 2009
    2,507
    456
    90
    takeown /f D:\*
    icacls D:\* /reset
    icacls D:\* /grant *S-1-1-0:F

    put that in a batch and replace D with your drive you want and run the bat as admin
     
  3. azert

    azert MDL Novice

    Jan 23, 2010
    3
    0
    0
    thnaks but it failed ....
    I 'm logged as admin

    D:\>takeown /f G:\IMG_2331.jpg
    Erreur*: Accès refusé.

    Means : error : access denied

    D:\>icacls G:\IMG_2331.jpg /reset
    G:\IMG_2331.jpg: Accès refusé.
    0 fichiers correctement traités*; échec du traitement de 1 fichiers

    D:\>icacls G:\IMG_2331.jpg /grant *S-1-1-0:F
    G:\IMG_2331.jpg: Accès refusé.
    0 fichiers correctement traités*; échec du traitement de 1 fichiers
     
  4. azert

    azert MDL Novice

    Jan 23, 2010
    3
    0
    0
    oups ! ...It works just fine !:!: thanks a lot !