Who owns this - an easy way to see who owns a file or folder.


  1. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #1

    Who owns this - an easy way to see who owns a file or folder.


    information   Information
    dir /q in a Command Prompt window will show you who the owner of a file or folder is. The following is my way of automating this so I can use it easily as often as I want.

    Add Who owns this to the Windows Explorer/File Explore/This PC right click Context Menu. When used it will show you who the current owner of a file or folder (and subfolders) is.

    Step 1:
    Create whoOwns.bat.
    Click Start, type notepad and press Enter.
    Copy and paste the following RED line into the Notepad window:

    dir /q %* > %temp%\whoOwnsRes.txt & notepad %temp%\whoOwnsRes.txt & del %temp%\whoOwnsRes.txt & exit

    Save the files as whoOwns.bat in a folder you will be keeping. Enclose the name in double quotes or set the Save as type to All files (*) to prevent Notepad from adding .txt to the end.

    Step 2:
    Create AddwhoOwns.reg as follows:

    Click Start, type notepad and press Enter.
    Copy and paste the following RED lines into the Notepad window:

    Windows Registry Editor Version 5.00

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\whoOwns]
    @="Who owns this"

    [HKEY_CLASSES_ROOT\*\shell\whoOwns\command]
    @=""C:\\xxxxxxxx\\whoOwns.bat" "%1""

    [HKEY_CLASSES_ROOT\Folder\shell\whoOwns]
    @="Who owns this"

    [HKEY_CLASSES_ROOT\Folder\shell\whoOwns\Command]
    @=""C:\\xxxxxxxx\\whoOwns.bat" "%1""

    Note: Change xxxxxxxx to the folder you put whoOwns.bat in.

    Save the file as AddwhoOwns.reg in a folder you will be keeping. Enclose the name in double quotes or set the Save as type to All files (*) to prevent Notepad from adding .txt to the end.

    Step 3:
    Merge AddwhoOwns.reg into you registry by double clicking on it or right clicking and select Merge.

    To use, open Windows Explorer/File Explore/This PC and navigate to the file or folder you are interested in.
    Right click on it and select Who owns this.

    A Command Prompt and a Notepad window will open with the results in file %temp%\whoOwnsRes.txt.
    When you close the Notepad window the %temp%\whoOwnsRes.txt file will be deleted and the Command Prompt window will close.

    For instance, if I do this for a folder like C:\Program Files, I get the following:
    Code:
    Volume in drive C is Lenovo_C
     Volume Serial Number is FC29-1F8F
    
     Directory of C:\Program Files
    
    03/19/2016  11:18 AM    <DIR>          NT SERVICE\TrustedInsta.
    03/19/2016  11:18 AM    <DIR>          NT SERVICE\TrustedInsta..
    03/03/2016  10:00 PM    <DIR>          BUILTIN\Administrators 7-Zip
    02/15/2016  03:12 PM    <DIR>          BUILTIN\Administrators CCleaner
    10/30/2015  03:24 AM    <DIR>          NT SERVICE\TrustedInstaCommon Files
    02/15/2016  02:33 PM    <DIR>          BUILTIN\Administrators Everything
    02/15/2016  07:18 PM    <DIR>          BUILTIN\Administrators Greenshot
    03/10/2016  12:19 PM    <DIR>          NT SERVICE\TrustedInstaInternet Explorer
    02/15/2016  05:35 PM    <DIR>          NT AUTHORITY\SYSTEM    Macrium
    02/15/2016  03:51 PM    <DIR>          BUILTIN\Administrators Malwarebytes
    02/20/2016  12:39 AM    <DIR>          BUILTIN\Administrators Microsoft Games
    02/15/2016  11:11 AM    <DIR>          NT AUTHORITY\SYSTEM    Microsoft LifeCam
    02/15/2016  12:57 PM    <DIR>          NT AUTHORITY\SYSTEM    Microsoft Office
    02/16/2016  11:04 PM    <DIR>          BUILTIN\Administrators MirrorFolder
    02/15/2016  08:01 PM    <DIR>          BUILTIN\Administrators Mozilla Firefox
    02/15/2016  07:50 PM    <DIR>          NT AUTHORITY\SYSTEM    MSBuild
    02/15/2016  11:11 AM    <DIR>          NT AUTHORITY\SYSTEM    NVIDIA Corporation
    02/15/2016  03:07 PM    <DIR>          BUILTIN\Administrators ooRexx
    02/17/2016  09:31 PM    <DIR>          NT AUTHORITY\SYSTEM    Oracle
    02/27/2016  09:11 PM    <DIR>          BUILTIN\Administrators Pale Moon
    02/15/2016  11:07 AM    <DIR>          NT AUTHORITY\SYSTEM    Realtek
    02/15/2016  07:50 PM    <DIR>          NT SERVICE\TrustedInstaReference Assemblies
    02/15/2016  03:57 PM    <DIR>          BUILTIN\Administrators Unlocker
    03/19/2016  11:16 AM    <DIR>          BUILTIN\Administrators VS Revo Group
    10/30/2015  05:02 AM    <DIR>          NT SERVICE\TrustedInstaWindows Defender
    03/02/2016  12:11 PM    <DIR>          NT SERVICE\TrustedInstaWindows Journal
    10/30/2015  05:02 AM    <DIR>          NT SERVICE\TrustedInstaWindows Mail
    03/10/2016  12:19 PM    <DIR>          NT SERVICE\TrustedInstaWindows Media Player
    03/10/2016  12:19 PM    <DIR>          NT SERVICE\TrustedInstaWindows Multimedia Platform
    10/30/2015  03:24 AM    <DIR>          NT SERVICE\TrustedInstaWindows NT
    10/30/2015  05:02 AM    <DIR>          NT SERVICE\TrustedInstaWindows Photo Viewer
    03/10/2016  12:19 PM    <DIR>          NT SERVICE\TrustedInstaWindows Portable Devices
                   0 File(s)              0 bytes
                  32 Dir(s)  140,497,846,272 bytes free
    When I do this for a file like C:\Users\rrkurtz\Documents\Ascenion Fall Festival.zdl, I get:
    Code:
     Volume in drive C is Lenovo_C
     Volume Serial Number is FC29-1F8F
    
     Directory of C:\Users\rrkurtz\Documents
    
    11/10/2006  08:17 PM        30,353,408 DESKTOP\rrkurtz        Ascenion Fall Festival.zdl
                   1 File(s)     30,353,408 bytes
                   0 Dir(s)  140,502,347,776 bytes free
      My Computers


  2. Posts : 2,799
    Linux Mint 20.1 Win10Prox64
       #2

    How about adding the "Owner" column to file explorer:

    Who owns this - an easy way to see who owns a file or folder.-.jpg
      My Computer


  3. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
    Thread Starter
       #3

    That's good too (actually it's excellent) but not as much fun.

    Thanks for the tip though.
      My Computers


  4. Posts : 14
    Windows 10 Pro 1607
       #4

    the "Owner" column doesnt appear in the immediate context menu for the columns in any folder except ones that i went to "more" with and already enabled, do you have a good explanation for either getting all folders viewed through file explorer window to have the column or to get that option to be sticky within the context menu's suggested columns? As its a little meticulous to go to every folder and navigate to the owner option for them the way i seem to be doing it.

    Just thinking that is a great feature when combined with the registry edit that adds the "take ownership" option to files/folders context menus.
      My Computer


  5. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
    Thread Starter
       #5

    In File Explorer, with the Owner column showing, click on View then Options at far right, then Change folder and search options.
    Click on the View tab then Apply to all folders. That makes it universal for me.
      My Computers


  6. Posts : 15
    Windows 10 Pro X64
       #6

    Hi,

    I appreciate this is an old thread, but I should be grateful for your advice.

    If I directly call the .bat file you so kindly provided, it works. However, if I try to use the File Explorer extension, I get a Windows error message that there is no app associated with the file type to perform the action.

    Any ideas?

    Thank you.
      My Computer


  7. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
    Thread Starter
       #7

    Sorry for the late response, I was never notified of your post.

    Did you edit the .reg file to point to wherever you stored the .whoOwns.bat file as described in Post #1, then merge it into the registry (Double click on it or right click and select Merge)?
      My Computers


 

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

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




Windows 10 Forums