Any workaround as to how to keep track on OneDrive on demand files

Page 1 of 2 12 LastLast

  1. Posts : 868
    Windows 10 x64
       #1

    Any workaround as to how to keep track on OneDrive on demand files


    In order to save space, one may store files on Onedrive and make them available on demand only, i.e. uncheck the folders in "Choose folders" and hide them from Explorer.

    Obviously, over time, months, years, it gets difficult to keep track on what all has been stored on OneDrive 'on demand only': there is no way to perform a search for specific files.

    AFAIK there is no workaround, so as to keep track of those files(??)

    Or has someone found some sort of solution?

    Thanks.
      My Computer


  2. Posts : 43,004
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    You’ll know that Files On-Demand is turned on if you see the status icons next to your files in File Explorer:

    Online-only files don’t take up space on your computer. You see a cloud icon for each online-only file in File Explorer, but the file doesn’t download to your device until you open it. You can’t open online-only files when your device isn’t connected to the Internet.
    Turn On or Off OneDrive Files On-Demand in Windows 10

    It seems (I don't use Onedrive) a filename reference should be visible in file explorer to 'on demand' files (which are held in cloud storage).

    This would suggest the filename at least may still be indexed, and so be searchable. I have no idea if it is.
    Last edited by dalchina; 19 Aug 2023 at 00:32.
      My Computers


  3. Posts : 776
    Windows 7
       #3

    You can't use Explorer to search for On Demand (dehydrated) files.

    But a little PowerShell magic can help.
    Getting full file attributes for files managed by Microsoft OneDrive

    Find_OnDemand.bat
    Code:
    <# : batch script
    @echo off
    powershell -nop Invoke-Expression ([System.IO.File]::ReadAllText('%~f0'))
    goto :eof
    #>
    
    Get-ChildItem -Path $env:OneDrive -Recurse | foreach {
        $AttributesString = [Convert]::ToString((Get-ItemProperty $_.FullName).Attributes.value__, 16)
        if ($AttributesString -match '(1|5).....') {
            $Name = $_.FullName -replace [regex]::Escape($env:OneDrive)
    
            if (($_.Attributes -band [io.fileattributes]::Directory) -eq 'Directory') {
                '"{0}"' -f $Name
            }
            else {
                " $Name"
            }
        }
    }

    Folders are listed with quotes (""), to make it clear they're not regular files.
    Last edited by garlin; 18 Aug 2023 at 20:08.
      My Computer


  4. Posts : 868
    Windows 10 x64
    Thread Starter
       #4

    Thank you both! Sorry for the delay, some computer issues..

    Up front, I have to say: so far I am hardly using OneDrive. Even though having a 365 subscription.

    The main reason for that is that I (wrongly??) understood that
    -either you have stored your files 'online' only = no copy/no file details = nothing on your HDD, so no way to perform a search for specific files (they exist online only)
    or
    -save files online with actual copy on HDD, i.e. no space savings, plús extra backup copies e.g. on external drives
    (just in case something goes wrong with OneDrive or you have to perform a fresh install, resulting in an new empty OneDrive folder on your HDD: what will happen then with the files stored online when synchronizing? Not sure..)

    Anyway, I did a test and stored a folder with 1GB files 'online only' (free space).
    Till now I truly believed that that such folder would not exist in the HDD-OneDrive folder (as being stored online).

    The folder showed up on HDD as well. Huh...

    Again, for above reasons I hardly used OneDrive, so I've never tried this out


    Any workaround as to how to keep track on OneDrive on demand files-snagit-19082023-135257.png

    hush hush, else my status will be reset to "Junior Member" or something
      My Computer


  5. Posts : 43,004
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #5

    One problem with Onedrive is that it's somewhat complicated- hard to understand and keep in mind the nuances of the options and their implications for real life usage. (And witness the number of OneDrive tutorials - in the Tutorials section... do have a look).

    So, out of curiosity- do you find your 'on demand files are actually indexable and findable by Windows Search?
      My Computers


  6. Posts : 868
    Windows 10 x64
    Thread Starter
       #6

    Thanks. I am using Everything (Voidtools) to search for files. That works well. as for indexing content: that I am not sure of right now.
    Normally I use X1.
    X1 doesn't touch the time-stamps of files.
    Have not been using it for a while though: need to do some serious reorganizing on my HDD's first.
    It became a mess... it is a timeconsuming, above all, boring task.

    I'll keep that in mind and test it.
      My Computer


  7. Posts : 776
    Windows 7
       #7

    Windows 10/11 has support for cloud-based filesystems, so whether you use OneDrive, Dropbox or Google Drive -- they use the same API to the Windows filesystem.

    The API introduces the concept of hydration, a file can be locally stored or serves as a placeholder (on demand). Dehydrated files or folders only provide you with their name, date, file size and limited attributes. If you perform any file operation to browse on-demand files (or index their contents), it will trigger a sync download.

    By default, Windows Search doesn't index OneDrive folders since it wants to read each file to index keywords. This would trigger hydration, and undo the on demand status. 3rd-party indexers may not treat those folders & files with the same care.

    Outside of browsing in Explorer, there's no simple way of determining a file's status. This is where the script comes in, it searches all the OneDrive folders and reports which ones are currently on demand.
      My Computer


  8. Posts : 43,004
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #8

    Understood- what I was wondering was this:
    Windows search doesn't have to be specified to perform content indexing. That can be disabled on a folder, file or file type basis.

    Unless metadata were necessarily indexed, I'd have thought it might be possible for indexing to occur on the limited basis you mention- unless all files deemed 'hydrated' are in fact excluded by design regardless.

    I can't test it- so just curious.
      My Computers


  9. Posts : 776
    Windows 7
       #9

    I tested some free search tools, to see if they would trigger hydration:

    - Windows Search: No
    - Everything: No
    - grepWin: Yes, triggered hydration of every dehydrated OneDrive folder or file
    - Listary: Yes, triggered the file I searched
    - SearchMyFiles: No

    You can probably assume software written by a vendor would understand hydration, and maybe a smaller developer isn't concerned about it.
    Last edited by garlin; 19 Aug 2023 at 16:36.
      My Computer


  10. Posts : 5
    Windows 10
       #10

    SOLUTION that worked for me... Jan 2024 Win10


    I found a solution to OneDrive not being included as part of Windows Search Index. You can keep your files in the cloud, and where they are now, and this still works.

    For any folder you want to be part of Windows Search Index, OneDrive folders included... you need to change the permissions, and possibly ownership. I changed all my searchable folders to add "Everyone", with "full control".

    Your computer may choke on doing this to one very large OneDrive folder and if it does, just do one smaller folder at a time.

    You'll immediately see that those folders are now searchable via your Windows key, and typing a few letters.

    NOTE that you still won't see the OneDrive folder as an selectable option under Windows Search options! It doesn't matter. Windows will index it regardless. As for that "Don't use the index when searching in file folders for system files..." check box found under "File Explorer Options" (found only from a File Explorer window)... it doesn't seem to make a difference for me. I have it UNCHECKED and it works great. Changing the folder permissions did make a difference tho.

    ANOTHER NOTE... I did make sure Windows was logged into my account that is the same as my OneDrive folder. But I'm not sure that helped. Changing permissions did.

    Here's the path to changing the PERMISSIONS for a folder:

    RIGHT click the folder and go to Properties - Security tab - Edit (under Group or user names) - Add - Advanced (button at the bottom left) - Find Now (on the right side) - in the list find and double-click "Everyone" - Press OK - Click on Everyone - click on the Full Control and Modify check boxes below - click ok.

    IF YOU GET ERRORS trying to change permissions, just tap to continue anyway. If you are desperate to just get it done, you have to change the OWNERSHIP of that folder. I changed it, like the files, to 'everyone' (yes, some will argue that unsafe to do, but hey, it's my PC and I'm ok with that)

    Here's the path to changing OWNERSHIP of your files and folders:

    Right click the folder and go to Properties - Security tab - click Advanced near the bottom - at the very top will show Name: xxxx and Owner: xxx CLICK on the blue highlighted "Change" - Advanced - Find Now - double-click on Everyone in the list below - Press OK - check the box at the top for "Replace owner on subcontainers and object" - Press OK ... and away it goes. THEN try to change security for all files and folder. It should work now.

    BE PERSISTENT... and Good luck!

    Danny B
    Carlsbad CA



    tfwul said:
    In order to save space, one may store files on Onedrive and make them available on demand only, i.e. uncheck the folders in "Choose folders" and hide them from Explorer.

    Obviously, over time, months, years, it gets difficult to keep track on what all has been stored on OneDrive 'on demand only': there is no way to perform a search for specific files.

    AFAIK there is no workaround, so as to keep track of those files(??)

    Or has someone found some sort of solution?

    Thanks.
      My Computer


 

  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 08:16.
Find Us




Windows 10 Forums