DOS listing of attached devices

Dell - inspiron 17.3" laptop - 4gb memor...
May 13, 2019 at 22:08:16
Specs: Windows 10 64 bit, Intel Core i5-4210U 1.7GHz/8GB
I can attach devices like my phone and my GoPro to my computer and see then in Windows Explorer but they don't get a drive letter like a external hard drive. Is there anyway to get access from the command prompt so I can do a directory listing?

See More: DOS listing of attached devices

Reply ↓  Report •

#1
May 13, 2019 at 22:35:06
They don't show in 'disk management' either? Windows should assign a drive letter to an SD card in those devices. If it's not and they do contain the cards you may need to remove them and use a card reader. Or check their manufacturing sites for software you can download to access the devices.

But no, if windows isn't assigning a drive letter then dos/command prompt can't either.


Reply ↓  Report •

#2
May 13, 2019 at 22:43:52
Thanks DAVE,

I will look at things again in the morning.


Reply ↓  Report •

#3
May 17, 2019 at 09:17:11
hi Dave,

I do see the phone under 'This PC'. I found a good article that suggested installing a WebDAV server on the phone and them mounting that server on the PC. I did this and now windows explorer shows my phone as the Z drive, but command line still doesn't seem to know about it.


Reply ↓  Report •

Related Solutions

#4
May 17, 2019 at 09:21:56
I found disk management and I don't see the phone there.

I forgot to mention that the other article indicated that the reason the phone doesn't get a drive letter right away is because it uses MTP (Media Transfer protocol) which is different that other USB devices.


Reply ↓  Report •

#5
May 17, 2019 at 11:20:04
I'm guessing that windows is naming the phone as a virtual drive in much the same way as it did in creating a virtual port for old dial up modems. IF command prompt can see the phone it may be a different drive letter. You may want to try all the letters of the alphabet and see if command prompt will acknowledge it at a different letter. But I suspect the software that allows windows to use the device won't work in command prompt.

An OS will only assign a drive letter if the device has a partition it recognizes. An SD card should fulfill that requirement but the rest of the phone wouldn't qualify. Additional software would be necessary for that. Back in the old days tape backups were common. However the OS wouldn't give them a drive letter. In order to read and write to the tape you needed to install the software provided by the manufacturer.


Reply ↓  Report •

#6
May 17, 2019 at 23:45:14
Phones and cameras that follow the Picture Transfer Protocol, which is pretty much all of them, aren't accessed as drives, even if Explorer presents them as pseudo drives. Android devices can expose their file system to the PC, in which case it presents itself as mass storage, and it'll get a drive letter.

How To Ask Questions The Smart Way


Reply ↓  Report •

#7
May 19, 2019 at 23:36:06
Razor,

I am confused by your answer. My phone is an android, but are you saying that it is still not accessible by command line? It didn't get a drive letter in windows Explorer either until I installed a webDAV, but even after that it still was not accessible from command line.


Reply ↓  Report •

#8
May 20, 2019 at 00:12:13
Looks like I'm behind the times. Mass storage was apparently removed some time ago. So yeah. Want to script file transfers between modern Android devices and your Windows box? Need to use VBScript or PowerShell and go through the Explorer Shell, via the Shell.Application COM objects.

How To Ask Questions The Smart Way


Reply ↓  Report •

#9
May 20, 2019 at 12:36:21
Double posting, but here's a quick and dirty example of the PowerShell version:
Set-Variable ssfDRIVES 17 -Option ReadOnly
Set-Variable ssfDESKTOP 0 -Option ReadOnly
$shell = New-Object -com Shell.Application
$desktop = $shell.NameSpace($ssfDESKTOP)
$shell.NameSpace($ssfDRIVES).Items() | 
 ? { $_.Type -eq 'Portable Device' } |
 % {
   $source = $_.GetFolder.Items().Item(0).GetFolder
   $dumpName = "{0} {1:yyyy_MM_dd}" -f $_.Name, (Get-Date)
   $desktop.NewFolder($dumpName)
   $desktop.ParseName($dumpName).GetFolder.CopyHere($source.Items())
 }
Remove-Variable dumpName, source, desktop, shell, ssf* -Force

How To Ask Questions The Smart Way


Reply ↓  Report •

#10
May 21, 2019 at 18:05:14
hi Razor,

I don't want to script the transfer of files, but I would love to get a directory listing in a text file from command line though to see what is in my music folder for example on my android phone.


Reply ↓  Report •

#11
May 21, 2019 at 20:41:33
Did you check your phone's web site for software allowing you access to the phone's memory? Any software would likely be windows-based and wouldn't give you a drive letter in command prompt but you'd at least be able to see what's there. I did find this:

https://www.apowersoft.com/access-a...

But again, I doubt it would work in command prompt.

Or reading the SD card in a card reader which could be done from command prompt?


Reply ↓  Report •

#12
May 22, 2019 at 07:51:11
I don't have an Android device on hand, but getting a list of all objects is theoretically more straightforward. From there, it should be easy enough to sort out the lines you want.
function listObjects($namespace, $parentPath) {
  foreach ($i in $namespace.Items()) {
    $p = ([IO.Path]::Combine($parentPath, $i.Name))
    if ($i.IsFolder) { listObjects $i.GetFolder $p }
    else             { $p }
  }
}

Set-Variable ssfDRIVES 17 -Option ReadOnly
$shell = New-Object -com Shell.Application
$shell.NameSpace($ssfDRIVES).Items() | 
 ? { $_.Type -eq 'Portable Device' } |
 % {
   $outName = "{0} {1:yyyy_MM_dd}.txt" -f $_.Name, (Get-Date)
   listObjects $_.GetFolder | Out-File $outName
 }
Remove-Variable outName, shell, ssfDRIVES -Force
rm function:\listObjects

EDIT: I should point out that Explorer will only tell me the name / path of these objects. The complex information like, "How big is the file?" and "How old is it?" is apparently a closely guarded secret between the device and Explorer. Beyond that, we'd have to start programming.

How To Ask Questions The Smart Way

message edited by Razor2.3


Reply ↓  Report •

Ask Question