OneDrive icon overlay: support seems incomplete or missing some settings ?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
wwe
Junior Member
Junior Member
Posts: 4
Joined: 2024-04-29, 09:27 UTC

OneDrive icon overlay: support seems incomplete or missing some settings ?

Post by *wwe »

Hi all bare with me if there is good answer already, I did search through the forum and followed some (old) threads but don't find good reference what and how the overlay icons are expected to work now.

I found this thread: viewtopic.php?t=48394 and added

Code: Select all

[Configuration]
IconOverlaysOneDrive=7
other references:
- viewtopic.php?p=434448
- viewtopic.php?p=451124

attributes I see using the script are following:

Code: Select all

Archive, ReparsePoint Available on this device        blocked-file.reg
525344 Always available on this device                file1.txt
5248544 Available when online                         file2.txt
Archive, ReparsePoint Available on this device        file3.txt
1049632                                               overlay.ps1
I learned overlays are stored in in a registry and verified there are multiple OneDrive keys (and no other sync tools overlay)

Code: Select all

PS C:\Users\user> gci "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\"              
    Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers

Name                           Property
----                           --------
 OneDrive1                     (default) : {BBACC218-34EA-4666-9D7A-C78F2274A524}
 OneDrive2                     (default) : {5AB7172C-9C11-405C-8DD5-AF20F3606282}
 OneDrive3                     (default) : {A78ED123-AB77-406B-9962-2A5D9D2F7F30}
 OneDrive4                     (default) : {F241C880-6982-4CE5-8CF7-7085BA96DA5A}
 OneDrive5                     (default) : {A0396A93-DC06-4AEF-BEE9-95FFCCAEF20E}
 OneDrive6                     (default) : {9AA2F32D-362A-42D9-9328-24A483E2CCC3}
 OneDrive7                     (default) : {C5FF006E-2AE9-408C-B85B-2DFDD5449D9C}
EnhancedStorageShell           (default) : {D9144DCD-E998-4ECA-AB6A-DCD83CCBA16D}
Offline Files                  (default) : {4E77131D-3629-431c-9818-C5679DC83E81}
I see the icons "in general" but somehow the support seems incomplete or I'm missing some settings.

- I see blue cloud icon in case if the file is "cloud-only"
- I see solid green mark if the file is "always keep on this device"
- I don't see "error" overlay when the file has e.g. blocked file type
- I don't see any overlay if the file is "dynamic" neither cloud-only nor "keep on this device"
- I don't see overlays icons on folders (in explorer this overlay are very handy to see where the problematic files are located)

Image: https://drive.google.com/file/d/1ho3Zhp5eaipz6uNX_Sqozh4IHVtnxjNX/view

Thank you in advance
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48173
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: OneDrive icon overlay

Post by *ghisler(Author) »

What does "blocked file type" mean? I tried blocking an extension in the OneDrive settings, but that didn't give it this "forbidden" icon in Explorer.
Author of Total Commander
https://www.ghisler.com
User avatar
wwe
Junior Member
Junior Member
Posts: 4
Joined: 2024-04-29, 09:27 UTC

Re: OneDrive icon overlay: support seems incomplete or missing some settings ?

Post by *wwe »

Sharepoint Admin can "block" (prevent) uploading certain file types e.g. .ps1 and .reg in my example (details https://learn.microsoft.com/en-us/sharepoint/block-file-types). If a user creates such file locally it would never sync to the cloud, in explorer this file is shown with solid red circle with a cross (same for directories where such files exist)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48173
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: OneDrive icon overlay: support seems incomplete or missing some settings ?

Post by *ghisler(Author) »

I see - there doesn't seem to be a way to recognize these, or is there a file attribute I can check?
Author of Total Commander
https://www.ghisler.com
User avatar
beb
Senior Member
Senior Member
Posts: 436
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: OneDrive icon overlay: support seems incomplete or missing some settings ?

Post by *beb »

Any files/folders that fall under the scope of specific restrictions and limitations listed in the given article would be 'blocked':

Restrictions and limitations in OneDrive and SharePoint
https://support.microsoft.com/en-us/office/64883a5d-228e-48f5-b3d2-eb39e07630fa
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
wwe
Junior Member
Junior Member
Posts: 4
Joined: 2024-04-29, 09:27 UTC

Re: OneDrive icon overlay: support seems incomplete or missing some settings ?

Post by *wwe »

There is a project on Github including a PowerShell module https://github.com/rodneyviana/ODSyncService/tree/master/ODNative showing at least the overall status. My coding skills are not good enough to understand what happens behind the scenes but it seems to collect the status from the running OneDrive process. For files it shows OnDemandOrUnknown for "cloud" files, "UpToDate" in case the file is hydrated locally and "Error" for blocked files and directories with some blocked files.

I'm not sure how it work from the performance perspective and if Windows Explorer is using other APIs.. hopefully it can be added to Total Commander - especially the error signal is important IMHO
User avatar
wwe
Junior Member
Junior Member
Posts: 4
Joined: 2024-04-29, 09:27 UTC

Re: OneDrive icon overlay: support seems incomplete or missing some settings ?

Post by *wwe »

I found another way - looks this one is built-in in the OS (tested on Windows 10 PowerShell):

Code: Select all

# ID 303 = "Availability status" | The status is generally one of the following...
# "Always available on this device", "Available on this device", "Available when online"
$OneDriveDocs = "$env:OneDrive\Documents"
$Shell = (New-Object -ComObject Shell.Application).NameSpace((Split-Path $OneDriveDocs))
$Status = $Shell.getDetailsOf(($Shell.ParseName((Split-Path $OneDriveDocs -Leaf))),303)
from: https://techcommunity.microsoft.com/t5/onedrive/is-there-any-way-to-get-the-sync-status-using-powershell-script/m-p/3564916/highlight/true#M10002

works same way as above: $status is
- "Error" for files which failed to upload,
- "Available on this device" for locally cached files
- "Available when online" for cloud-only files
- "Excluded (not synced)" - no status sign in Explorer

I tested this PowerShell script (results are exactly what I would like to see in TC: https://drive.google.com/file/d/1UPuvSh5nmi0QYbo5mctzYDF8ADkY4-3y/view?usp=drive_link)

Code: Select all

$files = gci -Recurse "$env:OneDrive\Dokumente\Tools\" |select -exp fullname
$y = foreach ($item in $files){
    $folder = Split-Path $item
    $file= Split-Path $item -Leaf
    $Shell = (New-Object -ComObject Shell.Application -OutVariable zzz).NameSpace($folder)
    $basename = $Shell.getDetailsOf(($Shell.ParseName($file)),0)
    $modified = $Shell.getDetailsOf(($Shell.ParseName($file)),3)
    $created = $Shell.getDetailsOf(($Shell.ParseName($file)),4)
    $size = $Shell.getDetailsOf(($Shell.ParseName($file)),1)
    $owner = $Shell.getDetailsOf(($Shell.ParseName($file)),10)
    $folderpath = $Shell.getDetailsOf(($Shell.ParseName($file)),191)
    $foldername = $Shell.getDetailsOf(($Shell.ParseName($file)),192)
    $fullname = $Shell.getDetailsOf(($Shell.ParseName($file)),194)
    $availability = $Shell.getDetailsOf(($Shell.ParseName($file)),303)

    New-Object -TypeName PSCustomObject -Property @{
      fullname = $fullname;
      basename = $basename;
      created = $created;
      modified = $modified;
      size = $size;
      availability = $availability;
      folder = $foldername;
      folderpath = $folderpath;
      owner = $owner
    }
}
$y|select basename,availability,modified,size|ogv
it takes 2.1 sec for 239 files and drops to 1.6 sec if you only collect 5 attributes and 1.3sec with 2 attributes only.

in this script $Shell instance is created for each file - as it is only required once per directory creating it only once it should speedup the process a bit - but maybe you have better options inside of Total Commander.. hopefully this helps.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48173
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: OneDrive icon overlay: support seems incomplete or missing some settings ?

Post by *ghisler(Author) »

OK, calling getDetailsOf with parameter 303 should work also via normal OLE system calls, but it would be slow to call for every single file.

The main 3 options returned are already by TC via file attributes returned when reading the directory:
1. "Always available on this device": Attribute FILE_ATTRIBUTE_PINNED is set -> green circle overlay
2. "Available on this device": No special attribute, no overlay
3. "Available when online": Attribute FILE_ATTRIBUTE_RECALL_ON_OPEN or FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS is set -> cloud icon overlay

I can't find any special attribute for "Excluded (not synced)":
https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants
Author of Total Commander
https://www.ghisler.com
Post Reply