If it's true that Android phones use MTP to connect to pc's when in "File transfer" mode, than PowerShell is a solution, I just answered this on StackOverflow: https://stackoverflow.com/a/75543733/3090890
Slightly edited copy of my answer on StackOverflow below.
I found this PowerShell script: https://github.com/nosalan/powershell-mtp-file-transfer/
Disclaimer: I'm not the author of the script, so credits belong to him!
Just for this answer, I copied and pasted code snippets from the linked source to provide it with some explanation.
The trick to access the phone, which should be in "File transfer" mode when connected through USB, is in this part:
$phoneName = "Nokia 7.2"
$o = New-Object -com Shell.Application
$rootComputerDirectory = $o.NameSpace(0x11)
$phoneDirectory = $rootComputerDirectory.Items() | Where-Object {$_.Name -eq $phoneName} | select -First 1
Then you are able to traverse to the directory you want:
$sourceFolder = $phoneDirectory
$phoneFolderName = "Internal shared storage\DCIM\Camera"
foreach($pathSegment in ($phoneFolderName -split "\\"))
{
$sourceFolder = $sourceFolder.GetFolder.Items() | Where-Object {$_.Name -eq $pathSegment} | select -First 1
if($sourceFolder -eq $null)
{
throw "Not found $phoneFolderName folder"
}
}
And finally copy items from the reached sourceFolder to the destination:
function Get-FullPathOfMtpDir($mtpDir)
{
$fullDirPath = ""
$directory = $mtpDir.GetFolder
while($directory -ne $null)
{
$fullDirPath = -join($directory.Title, '\', $fullDirPath)
$directory = $directory.ParentFolder;
}
return $fullDirPath
}
$targetFolder = "E:\Test"
$destDirShell = (new-object -com Shell.Application).NameSpace($targetFolder)
$fullSourceDirPath = Get-FullPathOfMtpDir $sourceFolder
foreach ($item in $sourceFolder.GetFolder.Items())
{
$itemName = ($item.Name)
$fullFilePath = Join-Path -Path $targetFolder -ChildPath $itemName
if(Test-Path $fullFilePath)
{
Write-Host "Element '$itemName' already exists"
}
else
{
$copiedCount++;
Write-Host ("Copying #{0}: {1}{2}" -f $copiedCount, $fullSourceDirPath, $item.Name)
$destDirShell.CopyHere($item)
}
}
Write-Host "Copied '$copiedCount' elements from '$fullSourceDirPath'"
It's also possible to copy files back to the phone. Here I swap the target and source as example, and copy "E:\Test\atestfileonpc.txt" to the phone's "DCIM\Camera" folder:
$sourceDirShell = (new-object -com Shell.Application).NameSpace($targetFolder)
$targetDirShell = $sourceFolder
$item = $sourceDirShell.Items() | Where-Object {$_.Name -eq "atestfileonpc.txt"} | select -First 1
targetDirShell.GetFolder.CopyHere($item)