A file that one needs to share with another device at the same physical location must be stored on OneDrive. Windows imposes a total 5GB limit for the files stored in OneDrive.
I need to get a list of all the files in OneDrive sorted by file size. To get the list using Windows File Explorer, I would need numerous executions--one for each level of subfolders. I'm hopeful that I can get that list with a lot fewer Command Prompt executions.
Thanks for your help,
SweetTasha.
Get a sorted list of the files in Windows OneDrive.
-
- Posts: 10
- Joined: 2021-Sep-11, 4:24 am
- Simon Sheppard
- Posts: 192
- Joined: 2021-Jul-10, 7:46 pm
- Contact:
Re: Get a sorted list of the files in Windows OneDrive.
You can get to the OneDrive synchronisation folder from the %OneDrive% variable
So
or you can use Robocopy List:
This assumes all the files have been synced.
So
Code: Select all
dir /s %OneDrive%
Code: Select all
robocopy %OneDrive% c:\null /l /njh /njs
-
- Posts: 10
- Joined: 2021-Sep-11, 4:24 am
Re: Get a sorted list of the files in Windows OneDrive.
Thanks Simon.I used the robocopy example.
Phil/SweetTasha
Phil/SweetTasha
- Patrick schlienger
- Posts: 1
- Joined: 2024-Mar-28, 11:52 am
- Location: France
- Contact:
Re: Get a sorted list of the files in Windows OneDrive.
It works for me too thanks
https://linktr.ee/patrickschlienger
-
- Posts: 1
- Joined: 2024-Apr-03, 2:32 am
Re: Get a sorted list of the files in Windows OneDrive.
You can use Command Prompt or PowerShell to achieve this more efficiently. Here's a PowerShell command that lists all files in your OneDrive directory sorted by file size:
Code: Select all
Get-ChildItem -Path "$env:USERPROFILE\OneDrive" -Recurse | Where-Object {!$_.PSIsContainer} | Select-Object FullName, Length | Sort-Object Length -Descending