Adding a new owner for the file, explorer doesn't update

Page 2 of 2 FirstFirst 12

  1. Posts : 25,847
    Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
       #11

    Ridvan said:
    Guys, I can think everything you suggested. But I need a solution for my problem, I dont want suggestions.
    This kind of post will get you very few solutions if any at all.
      My Computer


  2. Posts : 2,465
    Windows 7 Ultimate x64
       #12

    Ridvan said:
    Guys, I can think everything you suggested. But I need a solution for my problem, I dont want suggestions.
    What kind of proposition would you consider as a "solution"? Given that your concrete problem is not clear, I can't think of a concrete solution.

    "Marking" files as viewed or not is not the task of a filesystem or Windows Explorer, to begin with, and I suppose that what's you're trying to do right?

    One last from my part, use the archive attribute, enable the attributes column, and if it shows an "A", it's viewed. Remember to change it after you viewed it, under properties => Advanced => File for archiving (the first checkbox).
      My Computer


  3. Posts : 10,485
    W7 Pro SP1 64bit
       #13

    Ridvan said:
    I am thinking of something to mark my video files as watched or not watched on Windows Explorer.

    And I have an idea. Showing the owner tab on windows explorer and changing it from rightclick as watched. So I created a new user profile named WATCHED. And I tried this code from cmd.

    Code:
    icacls D:\Folder\TvSeries\video.720p.mkv /grant WATCHED:F /q
    It grants WATCHED user as a owner but on windows explorer it shows the main one. So It doesn't making any difference. How can I fix that?
    You granted the user named WATCHED full NTFS file access rights. The command that you issued has nothing to do with file ownership. Take a look at the help info for icacls:

    Code:
    C:\>icacls /?
    
    ICACLS name /save aclfile [/T] [/C] [/L] [/Q]
        stores the DACLs for the files and folders that match the name
        into aclfile for later use with /restore. Note that SACLs,
        owner, or integrity labels are not saved.
    
    ICACLS directory [/substitute SidOld SidNew [...]] /restore aclfile
                     [/C] [/L] [/Q]
        applies the stored DACLs to files in directory.
    
    ICACLS name /setowner user [/T] [/C] [/L] [/Q]
        changes the owner of all matching names. This option does not
        force a change of ownership; use the takeown.exe utility for
        that purpose.
    
    ICACLS name /findsid Sid [/T] [/C] [/L] [/Q]
        finds all matching names that contain an ACL
        explicitly mentioning Sid.
    
    ICACLS name /verify [/T] [/C] [/L] [/Q]
        finds all files whose ACL is not in canonical form or whose
        lengths are inconsistent with ACE counts.
    
    ICACLS name /reset [/T] [/C] [/L] [/Q]
        replaces ACLs with default inherited ACLs for all matching files.
    
    ICACLS name [/grant[:r] Sid:perm[...]]
           [/deny Sid:perm [...]]
           [/remove[:g|:d]] Sid[...]] [/T] [/C] [/L] [/Q]
           [/setintegritylevel Level:policy[...]]
    
        /grant[:r] Sid:perm grants the specified user access rights. With :r,
            the permissions replace any previouly granted explicit permissions.
            Without :r, the permissions are added to any previously granted
            explicit permissions.
    
        /deny Sid:perm explicitly denies the specified user access rights.
            An explicit deny ACE is added for the stated permissions and
            the same permissions in any explicit grant are removed.
    
        /remove[:[g|d]] Sid removes all occurrences of Sid in the ACL. With
            :g, it removes all occurrences of granted rights to that Sid. With
            :d, it removes all occurrences of denied rights to that Sid.
    
        /setintegritylevel [(CI)(OI)]Level explicitly adds an integrity
            ACE to all matching files.  The level is to be specified as one
            of:
                L[ow]
                M[edium]
                H[igh]
            Inheritance options for the integrity ACE may precede the level
            and are applied only to directories.
    
        /inheritance:e|d|r
            e - enables inheritance
            d - disables inheritance and copy the ACEs
            r - remove all inherited ACEs
    
    
    Note:
        Sids may be in either numerical or friendly name form. If a numerical
        form is given, affix a * to the start of the SID.
    
        /T indicates that this operation is performed on all matching
            files/directories below the directories specified in the name.
    
        /C indicates that this operation will continue on all file errors.
            Error messages will still be displayed.
    
        /L indicates that this operation is performed on a symbolic link
           itself versus its target.
    
        /Q indicates that icacls should supress success messages.
    
        ICACLS preserves the canonical ordering of ACE entries:
                Explicit denials
                Explicit grants
                Inherited denials
                Inherited grants
    
        perm is a permission mask and can be specified in one of two forms:
            a sequence of simple rights:
                    N - no access
                    F - full access
                    M - modify access
                    RX - read and execute access
                    R - read-only access
                    W - write-only access
                    D - delete access
            a comma-separated list in parentheses of specific rights:
                    DE - delete
                    RC - read control
                    WDAC - write DAC
                    WO - write owner
                    S - synchronize
                    AS - access system security
                    MA - maximum allowed
                    GR - generic read
                    GW - generic write
                    GE - generic execute
                    GA - generic all
                    RD - read data/list directory
                    WD - write data/add file
                    AD - append data/add subdirectory
                    REA - read extended attributes
                    WEA - write extended attributes
                    X - execute/traverse
                    DC - delete child
                    RA - read attributes
                    WA - write attributes
            inheritance rights may precede either form and are applied
            only to directories:
                    (OI) - object inherit
                    (CI) - container inherit
                    (IO) - inherit only
                    (NP) - don't propagate inherit
                    (I) - permission inherited from parent container
    
    Examples:
    
            icacls c:\windows\* /save AclFile /T
            - Will save the ACLs for all files under c:\windows
              and its subdirectories to AclFile.
    
            icacls c:\windows\ /restore AclFile
            - Will restore the Acls for every file within
              AclFile that exists in c:\windows and its subdirectories.
    
            icacls file /grant Administrator:(D,WDAC)
            - Will grant the user Administrator Delete and Write DAC
              permissions to file.
    
            icacls file /grant *S-1-1-0:(D,WDAC)
            - Will grant the user defined by sid S-1-1-0 Delete and
              Write DAC permissions to file.
      My Computer


  4. Posts : 71,977
    64-bit Windows 11 Pro for Workstations
       #14

    Hello Ridvan,

    As UserNameIssues posted above, the command you used would only set permissions for the file. If you are not the owner or do not already have access rights, then the command would not be able to set permissions and is why you do not see the change in the file's properties.

    You will need to take ownership of the file first, then grant permission. OPTION TWO in the tutorial below can help show you more on this.

    Take Ownership of file

    Hope this helps, :)
    Shawn
      My Computer


  5. Posts : 10,485
    W7 Pro SP1 64bit
       #15

    @Brink,
    I'm pretty sure that the OP is already the owner of these files.

    The OP wants to give away file ownership to mark videos as having been watched.


    Code:
    icacls D:\Folder\TvSeries\video.720p.mkv /setowner WATCHED


    Add_Mark_as_WATCHED.reg
    Code:
    Windows Registry Editor Version 5.00
    
    [-HKEY_CLASSES_ROOT\*\shell\runas]
    
    [HKEY_CLASSES_ROOT\*\shell\runas]
    @="Mark as WATCHED"
    "Icon"="C:\\Windows\\System32\\imageres.dll,-78"
    "NoWorkingDirectory"=""
    
    [HKEY_CLASSES_ROOT\*\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /setowner WATCHED"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /setowner WATCHED"
    "Mark as WATCHED" can be changed to almost any desired text.


    Remove_Mark_as_WATCHED.reg
    Code:
    Windows Registry Editor Version 5.00
    
    [-HKEY_CLASSES_ROOT\*\shell\runas]
    If the OP wants more that one RunAs...
    (e.g. wants take ownership and mark as watched)
    ...then something like this might work:
    Multiple runas reg entries still possible? - Windows 7 - MSFN Forum


    edit:
    The reg file is just for the context menu for files.

    I left the takeown commands just in case.
    One is essentially taking ownership and then giving it away.

    I have no idea what IsolatedCommand does. It does not seem to be needed, but I left it in since it is sprinkled all over the web when making these RunAs things.

    The two reg files are in the attached zip.
    Adding a new owner for the file, explorer doesn't update Attached Files
    Last edited by UsernameIssues; 13 Mar 2014 at 05:49.
      My Computer


  6. Posts : 9
    Windows 7 Ultimate 32bit
    Thread Starter
       #16

    @UsernameIssues

    Thanks for the awesome solution. Works like charm!

    edit: I tried to add this command in HKEY_CLASSES_ROOT\SystemFileAssociations\.mkv\Shell\Watched\command
    it didn't work. Is it possible to add this command only for .mkv .avi .mp4 files? Either way I am happy.
      My Computer


  7. Posts : 10,485
    W7 Pro SP1 64bit
       #17

    Glad that it worked for you.

    I don't see an easy way to make the context menu extension specific.

    Maybe other forum members know of a way to do that.
      My Computer


  8. Posts : 9
    Windows 7 Ultimate 32bit
    Thread Starter
       #18

    I handled it now it's working exactly like I want.
      My Computer


 
Page 2 of 2 FirstFirst 12

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 21:24.
Find Us