Does storage sense deletion works for nested folder and files?

Anonymous
2025-01-20T00:50:37+00:00

I have turned on storage sense deletion which works perfectly for the root level of the downloads folder, however, doesn't when there is any nested folder residing in there. Is this a known issue? If yes, beside manual cleanup, is there any other solution to this issue?

***moved from Microsoft 365 and Office / Other / For business / Other***

Windows for business | Windows Client for IT Pros | Storage high availability | Clustering and high availability

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Anonymous
    2025-01-20T08:47:19+00:00

    Hi NSVM

    Welcome to Microsoft Community.

    Based on your description, I understand that you're wondering if the storage-aware deletion feature applies to nested folders and files, and I understand very well how you feel!

    Yes, Storage Sense does not normally automatically delete files within nested folders in the Downloads folder, this is a known behavior. It mainly targets files in the root level of a given folder.

    This is because Storage Sense is designed to focus primarily on the root path of files, with the goal of avoiding accidental deletion of files that the user has intentionally saved. In many cases, users may have important data stored in nested folders and do not want them to be accidentally deleted.

    I personally have some suggestions that I hope will help.

    Option 1: Although you mentioned that you would like to know some solutions other than manual cleanup.

    However, I personally have a manual cleanup habit that I would like to provide you with that may help you in a routine or specific cleanup.

    In manual cleanup, we can start by manually checking the downloads folder, especially the nested folders, to filter out the older files for deletion. You can make this process easier by sorting the files by their modification date.

    Option 2: Partial filesWe can clean up unnecessary files more comprehensively with Windows' built-in Disk Cleanup utility.

    Click “WIN key” to open the search bar -> Type “Disk Cleanup” and open it -> At this point we can clean up according to the actual situation.

    We can also regularly clean up some of the system residual files, such as residual update installation package, the use of cache and so on.

    Option 3: If you have some knowledge of scripting, you can use PowerShell scripts to automatically delete old files in nested folders. (However, this method requires some knowledge of PowerShell scripting and coding, and may not be suitable for all users)

    Example:

    Get-ChildItem "C:\Path\To\Your\Downloads" -Recurse | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-30)} | Remove-Item -Force
    

    This command deletes files in all subfolders of the Downloads folder that have not been accessed in the last 30 days.

    Please note: If you are not particularly familiar with PowerShell scripting and coding, I would recommend that you do not use it. This is because the code I have given as an example needs to be modified according to the actual situation, and improper writing may result in some needed files and folders being deleted by mistake!

    Option 4: If necessary, we can also consider using some third-party cleaning tools, such as CCleaner and so on.

    Due to the community rules, I can't provide you with specific third-party tools, you can check the information through Github, Reddit and other technical communities, and choose a reliable and safe third-party tool.

    But tools dedicated to cleanup usually offer more flexible management options that can handle files in both root and nested folders.

    It even helps us to clean up the residual files, folders, and registries.

    Option 5: If you want to continue to let the memory-sensing deletion function do the deletion for you automatically.

    We may consider optimizing the way the download folder is stored and reducing the use of nested folders to simplify day-to-day management.

    I sincerely hope that the above information and programs will help you! Please feel free to contact me (Photos related to the question would be great!).

    I look forward to hearing back from you. 

    Best Regards

    Arthur Sheng | Microsoft Community Support Specialist

    0 comments No comments
  2. Anonymous
    2025-01-20T22:14:55+00:00

    Thank you for your response. Can you tell me about Option 5 please. How does that work. This setting I am referring to is required for more than 250 users. Is that doable, if not do you recommend a PS script schedule task or Intune Win32 app?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2025-01-21T12:49:45+00:00

    Thank you for your response.

    The focus of Option 5 is to optimize the download folder structure, with the primary goal of making the automatic deletion process smoother by minimizing the use of nested folders. This is done to simplify the organization of files within folders, thereby reducing the complexity of Storage Sense to effectively clean up files.

    However, with more than 250 users, managing this through manual optimization may not be practical or scalable. Considering your situation, a more automated approach is preferable.

    If you confirm that you need PS Scripts, Scheduled Tasks or the Intune Win32 application, please confirm and let me know in your reply.

    Please allow me to explain this to you and I will be more than happy to help you. But in order for the community to keep track of each thread to help other users, and for PS Scripts, Scheduled Tasks and Intune Win32 Apps, the corresponding boards and support staff will be able to provide you with a more tailored response.

    Receive your reply and confirm that you need support with PS Scripting, Scheduled Tasks and Intune Win32 Apps in order to automate your deployment management. I will move this thread to the appropriate board and the appropriate support staff will provide you with a more targeted solution and advice.

    I look forward to hearing from you and thank you for your understanding and patience!

    Have a wonderful week!

    0 comments No comments
  4. Anonymous
    2025-01-21T22:27:59+00:00

    Hi Arthur, Go, ahead and move the thread to the appropriate team. I would love the support with above mentioned ideas.

    0 comments No comments
  5. Anonymous
    2025-02-06T22:45:33+00:00

    Hi Arthur,

    Has there been any update on this thread?

    0 comments No comments