Manage files on USD device from CMD ?


cbreemer

Well-known member
Member
Local time
12:26 AM
Posts
98
OS
Windows 11 Pro Version 22H2 (OS Build 22621.3155)
Hi all, I wonder if there's a way to see recent files on an USB device from the command line rather than Windows Explorer ? I regularly want to grab the latest videos/photos from my Samsung Android A51 camera, but Explorer takes an awful long time to find them. I must admit there are thousands of media in the Camera folder.... I should really clean that up but that's a hell of a job. And it's probably just the Samsung interface being grindingly slow, but I somehow hope it might be better with a DIR command. Any ideas ?
 
Windows Build/Version
23H2 (OS Build 22631.3880)

My Computer My Computer

At a glance

Windows 11 Pro Version 22H2 (OS Build 22621.3...Intel Core i7-1260P64GbIntel Iris Xe Graphics
OS
Windows 11 Pro Version 22H2 (OS Build 22621.3155)
Computer type
PC/Desktop
Manufacturer/Model
Intel NUC12WSHi7
CPU
Intel Core i7-1260P
Motherboard
Intel NUC12WSHi7
Memory
64Gb
Graphics Card(s)
Intel Iris Xe Graphics
Sound Card
Intel Smart Sound for USB
Monitor(s) Displays
LG 34WP500 UltraWide Monitor
Screen Resolution
2560x1080
Hard Drives
Adata Legend 710 2Tb SSD
PNY CS9000 2Tb SSD
Keyboard
Logitech K540 Bluetooth
Mouse
Logitech M310 Bluetooth
Internet Speed
200Mbps
Browser
Chrome
Antivirus
Avast Free Antivirus
The forfiles command is your friend here.

FORFILES /P C:\WINDOWS /S /M *.txt /D +2024-6-12

Would give me all of the files in C:\Windows and subdirectories (/S), matching the pattern *.txt, created on or after June 12, 2024.
 

My Computer My Computer

At a glance

Windows 11 Pro 25H212th Gen Core i7-1260P64 GB Micron PC4-25600Intel Iris Xe Graphics
OS
Windows 11 Pro 25H2
Computer type
PC/Desktop
Manufacturer/Model
Intel NUC12WSHi7
CPU
12th Gen Core i7-1260P
Motherboard
NUC12WSBi7
Memory
64 GB Micron PC4-25600
Graphics Card(s)
Intel Iris Xe Graphics
Sound Card
on-board Realtek HD Audio
Monitor(s) Displays
Dell U3219Q
Screen Resolution
3840 x 2160
Hard Drives
Samsung SSD 990 PRO 1TB
Crucial MX500 2 TB
Antivirus
Microsoft Defender
The forfiles command is your friend here.

FORFILES /P C:\WINDOWS /S /M *.txt /D +2024-6-12

Would give me all of the files in C:\Windows and subdirectories (/S), matching the pattern *.txt, created on or after June 12, 2024.
Thanks for your quick reply ! I knew the command line would have useful commands like this. My problem is that I don't know the physical path name. In Explorer, my camera folder is
Code:
This PC\Chris A51\SD card\DCIM\Camera
but the command line does not recognize this path:

Code:
C:\Windows>dir "This PC\Chris A51\SD card\DCIM\Camera"
The system cannot find the path specified.


C:\Windows>dir "\\This PC\Chris A51\SD card\DCIM\Camera"
The network path was not found.


C:\Windows>dir "\This PC\Chris A51\SD card\DCIM\Camera"
The system cannot find the path specified.

What am I missing ?
 

My Computer My Computer

At a glance

Windows 11 Pro Version 22H2 (OS Build 22621.3...Intel Core i7-1260P64GbIntel Iris Xe Graphics
OS
Windows 11 Pro Version 22H2 (OS Build 22621.3155)
Computer type
PC/Desktop
Manufacturer/Model
Intel NUC12WSHi7
CPU
Intel Core i7-1260P
Motherboard
Intel NUC12WSHi7
Memory
64Gb
Graphics Card(s)
Intel Iris Xe Graphics
Sound Card
Intel Smart Sound for USB
Monitor(s) Displays
LG 34WP500 UltraWide Monitor
Screen Resolution
2560x1080
Hard Drives
Adata Legend 710 2Tb SSD
PNY CS9000 2Tb SSD
Keyboard
Logitech K540 Bluetooth
Mouse
Logitech M310 Bluetooth
Internet Speed
200Mbps
Browser
Chrome
Antivirus
Avast Free Antivirus
I don't have a device I can test with. Maybe you can right-click the folder and Open In Terminal? If it opens the terminal in the correct folder, you can skip the /P part altogether.
 

My Computer My Computer

At a glance

Windows 11 Pro 25H212th Gen Core i7-1260P64 GB Micron PC4-25600Intel Iris Xe Graphics
OS
Windows 11 Pro 25H2
Computer type
PC/Desktop
Manufacturer/Model
Intel NUC12WSHi7
CPU
12th Gen Core i7-1260P
Motherboard
NUC12WSBi7
Memory
64 GB Micron PC4-25600
Graphics Card(s)
Intel Iris Xe Graphics
Sound Card
on-board Realtek HD Audio
Monitor(s) Displays
Dell U3219Q
Screen Resolution
3840 x 2160
Hard Drives
Samsung SSD 990 PRO 1TB
Crucial MX500 2 TB
Antivirus
Microsoft Defender
I don't have a device I can test with. Maybe you can right-click the folder and Open In Terminal? If it opens the terminal in the correct folder, you can skip the /P part altogether.
I did not know about "Open in Terminal". Glad to have learnt about it, thanks. But as sod's luck would have it, this option is not shown for folders on my camera, only for regular devices (USB sticks included). The context menu for the camera is much smaller than usual. Clearly, the camera's file system is handled much different from anything else.
 

My Computer My Computer

At a glance

Windows 11 Pro Version 22H2 (OS Build 22621.3...Intel Core i7-1260P64GbIntel Iris Xe Graphics
OS
Windows 11 Pro Version 22H2 (OS Build 22621.3155)
Computer type
PC/Desktop
Manufacturer/Model
Intel NUC12WSHi7
CPU
Intel Core i7-1260P
Motherboard
Intel NUC12WSHi7
Memory
64Gb
Graphics Card(s)
Intel Iris Xe Graphics
Sound Card
Intel Smart Sound for USB
Monitor(s) Displays
LG 34WP500 UltraWide Monitor
Screen Resolution
2560x1080
Hard Drives
Adata Legend 710 2Tb SSD
PNY CS9000 2Tb SSD
Keyboard
Logitech K540 Bluetooth
Mouse
Logitech M310 Bluetooth
Internet Speed
200Mbps
Browser
Chrome
Antivirus
Avast Free Antivirus
For This PC use c:\Users
Is Chris A51 your user name?
 

My Computer My Computer

At a glance

Windows 11 ProINTEL i9-10920X LGA 206664 GB (4 X 16 GB) G-Skill V Series DDR4 3200 ...EVGA GTX 1060 SC 3 GB
OS
Windows 11 Pro
Computer type
PC/Desktop
Manufacturer/Model
Custom Built
CPU
INTEL i9-10920X LGA 2066
Motherboard
Gigabyte X299-UD4 Pro F9
Memory
64 GB (4 X 16 GB) G-Skill V Series DDR4 3200 Quad Channel
Graphics Card(s)
EVGA GTX 1060 SC 3 GB
Sound Card
Realtek Onboard ALC1220
Monitor(s) Displays
2 x Samsung S27E310
Screen Resolution
1920x1080
Hard Drives
2 x Samsung 970 EVO Plus NVMe M2 500B
2 x 6TB WD6003FZBX SATA
PSU
Seasonic X-1050
Case
Thermaltake Armor+
Cooling
Corsair H80i V2 Liquid AOI Cooler
Keyboard
Logitech G510s
Mouse
Logitech MX Master2S
Internet Speed
500Mbs
Browser
Edge (Canary, Dev, Beta,Stable), Chrome
Antivirus
ESET NOD32 17.0.16.0
Other Info
Netgear Orbi Mesh router,
LG WH12LS39K Blu-Ray/DVD,
Malwarebytes Pro 4.6.8
Cyber Power CP1500PFCLCD UPS
I would bet it’s an A51 phone belonging to a person named Chris.
 

My Computer My Computer

At a glance

Windows 11 Pro 25H212th Gen Core i7-1260P64 GB Micron PC4-25600Intel Iris Xe Graphics
OS
Windows 11 Pro 25H2
Computer type
PC/Desktop
Manufacturer/Model
Intel NUC12WSHi7
CPU
12th Gen Core i7-1260P
Motherboard
NUC12WSBi7
Memory
64 GB Micron PC4-25600
Graphics Card(s)
Intel Iris Xe Graphics
Sound Card
on-board Realtek HD Audio
Monitor(s) Displays
Dell U3219Q
Screen Resolution
3840 x 2160
Hard Drives
Samsung SSD 990 PRO 1TB
Crucial MX500 2 TB
Antivirus
Microsoft Defender
I would bet it’s an A51 phone belonging to a person named Chris.

It’s a bet I wouldn’t take against you. Put a thousand on for me also.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 Build 26200.8655Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz32.0 GB of I forget and the box is in storage.Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    OS
    Windows 11 Pro 25H2 Build 26200.8655
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built 2013
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    ROG SupremeFX Formula 8-Channel High Definition Audio
    Monitor(s) Displays
    5 x LG 25MS500-B - 1 x 24MK430H-B - 1 x Wacom Pro 22" Touch Screen Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list. OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech: G402 / G502 / Mx Masters / Mx Air Cordless
    Internet Speed
    2000/500Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
    TP-Link BE9300 WiFi 7 Bluetooth 5.4 (Archer TBE550E)
    TP-Link TX201 V1 2.5GB Lan

    Grandstream HT812 - VoIP
    ASUS DSL-AX82U - Mesh
    ASUS RT-AC68U - Mesh
    ASUS RT-BE88U Router

    Brother MFC-L2880DW Printer

    I’m on a horse.
  • At a glance

    Windows 11 Pro 25H2 Build 26200.8655 (Wifes)13th Generation Intel® Core™ i5-1340P Process...16GB LPDDR5-52001x Intel® Iris® Xe Graphics
    Operating System
    Windows 11 Pro 25H2 Build 26200.8655 (Wifes)
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7 14IRL8 - Type 82YL
    CPU
    13th Generation Intel® Core™ i5-1340P Processor(Core™ i5-1340P)
    Memory
    16GB LPDDR5-5200
    Graphics card(s)
    1x Intel® Iris® Xe Graphics
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512 GB SSD PCIe
    Mouse
    Logiteck MX Master 3S
    Internet Speed
    2000/500
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.


    Wireless Network: Wi-Fi 6E 2x2 AX; Bluetooth® 5.1 or above
    Ports: 1x 1 Novo button; 2 in 1 Audio Combo jack; Micro SD Card Reader; HDMI 1.4b; 2 x USB Type-C (TBT4)
    USB 3.2 Gen 2 DP 1.4a
    PD 3.0); 1 x USB 3.2 Gen1 Type A
    Camera
    1x 1080P FHD IR/RGB Hybrid with Privacy Shutter and Dual Array Microphone
    Graphics
    1x Intel® Iris® Xe Graphics
    Monitor
    14" WUXGA
    Form Factor
    Convertible Notebook
  • Windows 11 Pro 25H2 Build 26200.8655 (Wifes)

    Yoga 7 2-in-1 14IML9 - Type 83DJ

    Processor: Intel® Core™ Ultra 7 155H Processor(Core™ Ultra 7 155H)

    Memory: 32GB LPD5X-7467

    Hard Drive: 1 TB SSD PCIe

    Wireless Network: 1x Wi-Fi 6E 2x2 AX; Bluetooth® 5.1 or above

    Ports: 1 x HDMI 2.1 TMDS; 1 x Novo Button; 1 x Combo Audio Jack
    2 x USB-C (USB 4.0)
    1 x USB-A 3.2 Gen 1

    Camera: 1080P FHD IR Hybrid with Dual Microphone

    Graphics: Intel® Arc™ Graphics

    Monitor: 14" 2.8K

    ...Where's my horse?
my camera folder is
Code:
This PC\Chris A51\SD card\DCIM\Camera
but the command line does not recognize this path:
Code:
C:\Windows>dir "This PC\Chris A51\SD card\DCIM\Camera"
The system cannot find the path specified.

C:\Windows>dir "\\This PC\Chris A51\SD card\DCIM\Camera"
The network path was not found.

C:\Windows>dir "\This PC\Chris A51\SD card\DCIM\Camera"
The system cannot find the path specified.

If Chris A51 is the device name of a camera, then dir "\\Chris A51\SD card\DCIM\Camera" (without the 'This PC' bit) should work.

If Chris A51 is your user folder then you can use "%userprofile%\SD card\DCIM\Camera" in the command line.
The userprofile environment variable contains the path to your user folder.
 
Last edited:

My Computers My Computers

  • At a glance

    Windows 11 HomeAMD Athlon Silver 3050U8GBRadeon Graphics
    OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Acer Aspire 3 A315-23-R9VY
    CPU
    AMD Athlon Silver 3050U
    Memory
    8GB
    Graphics Card(s)
    Radeon Graphics
    Monitor(s) Displays
    laptop screen
    Screen Resolution
    1366x768 native resolution, up to 2560x1440 with Radeon Virtual Super Resolution
    Hard Drives
    1TB Samsung EVO 870 SSD (from April 2026: 250GB EVO 850)
    Internet Speed
    150 Mbps
    Browser
    Edge, Firefox
    Antivirus
    Defender
    Other Info
    fully 'Windows 11 ready' laptop. Windows 10 C: partition migrated from my old unsupported 'main machine' then upgraded to 11. A test migration ran Insider builds for 2 months. When 11 was released on 5th October 2021 it was re-imaged back to 10 and was offered the upgrade in Windows Update on 20th October. Windows Update offered the 22H2 Feature Update on 20th September 2022. It got the 23H2 Feature Update on 4th November 2023 through Windows Update, 24H2 on 3rd October 2024 through Windows Update by setting the Target Release Version for 24H2, and 25H2 on 30th September 2025 through Windows Update by setting the Target Release Version for 25H2.

    UPDATE - 11 April 2026: due to mechanical deterioration this PC has been retired from active duty. The OS with all software and files has been migrated to my System Seven in 'Other systems' to carry on as my general purpose 'main machine'.
  • At a glance

    Windows 11 ProIntel® Core™ i5-520M8GB(integrated graphics) Intel HD Graphics
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Latitude E4310
    CPU
    Intel® Core™ i5-520M
    Motherboard
    0T6M8G
    Memory
    8GB
    Graphics card(s)
    (integrated graphics) Intel HD Graphics
    Screen Resolution
    1366x768
    Hard Drives
    500GB Crucial MX500 SSD
    Browser
    Firefox, Edge
    Antivirus
    Defender
    Other Info
    unsupported machine: Legacy bios, MBR, TPM 1.2, upgraded from W10 to W11 using W10/W11 hybrid install media workaround.

    In-place upgrade to 22H2 using ISO and a workaround.
    Feature Update to 23H2 by manually installing the Enablement Package.
    In-place upgrade to 24H2 using hybrid 23H2/24H2 install media.
    Upgraded to 25H2 by Enablement Package.

    Also running Insider Dev, and Canary builds and Windows 10 as native boot .vhdx.
  • My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB NVMe ssd, supported device running Windows 11 Pro.

    My SYSTEM FOUR is a 2-in-1 convertible Lenovo Yoga 11e 20DA, Celeron N2930, 8GB RAM, 256GB ssd. Unsupported device: currently running Win10 Pro, plus Win11 Pro RTM and Insider Dev, Beta, and RP 24H2 as native boot vhdx.

    My SYSTEM FIVE is a Dell Latitude 3190 2-in-1, Pentium Silver N5030, 8GB RAM, 1TB NVMe ssd, supported device running Windows 11 Pro, plus Insider Beta, Dev, and Canary builds (and a few others) as a native boot .vhdx.

    My SYSTEM SIX is a Dell Latitude 5550, Core Ultra 7 165H, 64GB RAM, 1TB NVMe SSD, supported device, Windows 11 Pro 24H2, Hyper-V host machine. Updated to 25H2 on 30th September 2025.

    My SYSTEM SEVEN is a Lenovo Thinkpad T580, Intel Core i7-8650U, 16GB RAM, 512GB NVMe SSD + 2nd 512GB NVMe SSD, a supported device for Windows 11. This is my current general purpose 'main machine'. The installed Windows 11 Home from my System One has been migrated to this machine.
If Chris A51 is the device name of a camera, then dir "\\Chris A51\SD card\DCIM\Camera" (without the 'This PC' bit) should work.
Thanks for your reply. Indeed Chris A51 is the phone's device name.

2024-07-14_075038.jpg

Alas, that command does not work either. I believe I had already tried that too.

2024-07-14_075142.jpg
 
Last edited:

My Computer My Computer

At a glance

Windows 11 Pro Version 22H2 (OS Build 22621.3...Intel Core i7-1260P64GbIntel Iris Xe Graphics
OS
Windows 11 Pro Version 22H2 (OS Build 22621.3155)
Computer type
PC/Desktop
Manufacturer/Model
Intel NUC12WSHi7
CPU
Intel Core i7-1260P
Motherboard
Intel NUC12WSHi7
Memory
64Gb
Graphics Card(s)
Intel Iris Xe Graphics
Sound Card
Intel Smart Sound for USB
Monitor(s) Displays
LG 34WP500 UltraWide Monitor
Screen Resolution
2560x1080
Hard Drives
Adata Legend 710 2Tb SSD
PNY CS9000 2Tb SSD
Keyboard
Logitech K540 Bluetooth
Mouse
Logitech M310 Bluetooth
Internet Speed
200Mbps
Browser
Chrome
Antivirus
Avast Free Antivirus
Windows explorer is an object manager not simply a file manager. So it can represent objects from a device connected by media transfer protocol (mtp) as well as files. But mtp objects aren't files and you're trying to treat them as files - which is why it's not working.
It's possible to use the "shell objects for scripting" to work with these objects. If you try a Web search for "windows command line mtp" you should find some ideas as to how you might deal with these objects.
However, on your phone they are files, so with a file manager on your phone you should be able to sort and move files to different sub folders. You should also be able to change the default folder where photos are saved. If you did this monthly that might make managing the photos easier.
When you get the photos on your pc it will be easier to work with folders that don't contain thousands of images.

Mike
 

My Computers My Computers

  • At a glance

    Windows 11 25H2 Pro Build 26200i3-1215U8GB
    OS
    Windows 11 25H2 Pro Build 26200
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI PRO ADL-U Cubi 5 (MS-B0A8)
    CPU
    i3-1215U
    Memory
    8GB
    Monitor(s) Displays
    Sony 43" 4k TV
    Screen Resolution
    3840x2160
    Hard Drives
    250GB NVMe M.2 PCIe Gen 3 SSD
    PSU
    External 65W
    Case
    Mini PC
    Browser
    FireFox
    Antivirus
    MS
  • At a glance

    Windows 11 Pro 25H2Intel i3-910016GB DDR4
    Operating System
    Windows 11 Pro 25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 3070 SFF
    CPU
    Intel i3-9100
    Memory
    16GB DDR4
    Monitor(s) Displays
    Dell S2721
    Screen Resolution
    3840 x 2160
    Hard Drives
    Samsung 500GB nvMe
    Case
    Dell small form factor
    Keyboard
    Cherry mechanical (Blue)
    Mouse
    Microsoft
    Antivirus
    MS Defender
Thanks for that Mike. I guess you are right, Explorer does a decent job presenting the phone as a real filesystem, whereas it isn't. I'll check out these shell objects, but I think my best bet is, as you say, to organize the humongous wad of pics and videos on my phone. Damn grandkids 😁
 

My Computer My Computer

At a glance

Windows 11 Pro Version 22H2 (OS Build 22621.3...Intel Core i7-1260P64GbIntel Iris Xe Graphics
OS
Windows 11 Pro Version 22H2 (OS Build 22621.3155)
Computer type
PC/Desktop
Manufacturer/Model
Intel NUC12WSHi7
CPU
Intel Core i7-1260P
Motherboard
Intel NUC12WSHi7
Memory
64Gb
Graphics Card(s)
Intel Iris Xe Graphics
Sound Card
Intel Smart Sound for USB
Monitor(s) Displays
LG 34WP500 UltraWide Monitor
Screen Resolution
2560x1080
Hard Drives
Adata Legend 710 2Tb SSD
PNY CS9000 2Tb SSD
Keyboard
Logitech K540 Bluetooth
Mouse
Logitech M310 Bluetooth
Internet Speed
200Mbps
Browser
Chrome
Antivirus
Avast Free Antivirus
Back
Top Bottom