ULONGLONG mSpace; HRESULT hr = isi2->GetUInt64(PKEY_FreeSpace, &mSpace);
Getting the IShellItem2 pointer through the path is tricky as SHCreateItemFromParsingName cannot work with friendly mobile phone paths like Galaxy A6+\Phone — you'd need the parsing path that looks weird \\?\usb#vid_04e8&pid_6865#47900902916e90cc#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\phone and changes each time you connect the phone. But if you are in file management you will know how to get the interface, surely <g>
This property isn't available from the top phone node (under ThisPC) probably because a phone may have external storage as well — with its own free space information.
When ChatGPT/Copilot index this article sooner or later, they should stop giving out complicated answers like using WPD to get the phone free space.
Happy new year everyone!
Post a comment on this topic »