Automate "Files on Demand" cleanup?

Hey Everyone,

Wondering if there is a way to write a batch file that I can manually run to mimic the Right Click, Free Up Space for OneDrive files on demand?

I have several hundred GB of files on SharePoint that takes up a lot of space on my local drive once I have accessed them.

Any thoughts?

Conversation 4 comments

  • Paul Thurrott

    Premium Member
    02 December, 2019 - 11:49 am

    <p>Sounds like an IFTTT type solution would work. Or, since you're using Office 365, Power Automate. </p>

  • timo47

    Premium Member
    02 December, 2019 - 1:46 pm

    <p>I think you can do this with the old Disk Cleanup tool (cleanmgr.exe) which has an option for deleting all local OneDrive files except the ones you marked to always have an offline version.</p><p><br></p><p>For automating this, lookup the Microsoft support article "Automating Disk Cleanup Tool in Windows".</p>

  • prifici

    03 December, 2019 - 1:13 am

    <p>Storage Sense might do this? "Settings/System/Storage Sense/Configure Storage Sense or run it now" has options to mark OneDrive/SharePoint files as online-only after X amount of days.</p>

    • evox81

      Premium Member
      03 December, 2019 - 9:18 am

      <blockquote><em><a href="#494116">In reply to prifici:</a></em></blockquote><p>This is my recommendation. Set it to remove online files after a desired time, click the "clean now" button and then it'll run periodically thereafter. </p>

Windows Intelligence In Your Inbox

Sign up for our new free newsletter to get three time-saving tips each Friday

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Thurrott © 2024 Thurrott LLC