How to request OneDrive sync status for a given file

Now that Microsoft has restored OneDrive to the file system in Windows 10 (and assuming that they will not give birth again after 6 months), I'm looking for how to determine the synchronization status for an arbitrary file.

There are at least five different states in the conductor (this is exactly what I observed, there may be others):

  • Available Online Available online
  • Available on this device Available on this device
  • Always available on this device. Always available on this device.
  • Sync / Download Sync / Download
  • Mistake Mistake

The first two states for a file can be determined using the FILE_ATTRIBUTE_OFFLINE attribute.

It seems that the Always Available status can be defined for the file using the new undocumented file attribute 0x00080000 .

The definition of these states for folders, as well as synchronization and error states for files and folders, however, remains a mystery.

My first thought was to use a property system ( IPropertyStore ), but the following four property keys did not help:

  • PKEY_OfflineAvailability returns VT_EMPTY
  • PKEY_OfflineStatus returns VT_EMPTY
  • PKEY_FilePlaceholderStatus returns an undocumented value (0xe), but it does not change when the status executes
  • PKEY_FileOfflineAvailabilityStatus returns VT_EMPTY

I have a feeling that this will become just another undocumented Microsoft API, but I thought I'd ask to see if anyone had any suggestions.

+7
windows winapi windows-shell
source share

No one has answered this question yet.

See related questions:

1084
How can I pass arguments to a batch file?
713
How to install Python package with .whl file?
578
How to disable - restart - log out of Windows through the bat file?
547
How can I display a new line in a batch file?
485
How to remove a Windows service if the files no longer exist?
372
How to check if a file exists inside a batch file
86
<random> generates the same number on Linux, but not on Windows
5
How has Microsoft implemented shell extensions for the upcoming OneDrive On-Demand features?
2
How to create an IconList property in a Windows property system?
one
Access data for roaming is not synchronized between devices

All Articles