question

JakeSokol-9687 avatar image
0 Votes"
JakeSokol-9687 asked MotoX80 answered

Command prompt for This PC

Guys - I'm working on a batch script to copy files from my phone to my computer. However, the phone shows up as Pixel 4 and there isn't a drive letter attached to it in disk manager. Can you tell me how do I do a cd command or change directory to this particular directory structure? When I copy the path from a folder I need to copy files from, it shows up This PC\Pixel 4\Internal shared storage\DCIM\Camera but don't know how to call that in a .bat file Thx

windows-api
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RitaHan-MSFT avatar image
0 Votes"
RitaHan-MSFT answered

Hello @JakeSokol-9687,

Use mountvol in the command prompt you can get the ID of the volume you want to access like this:

41741-20201123-1.png

In a batch script you can try the following command to see if it helps:

 start \\?\Volume{578d75fd-0000-0000-0000-100000000000}\

Thank you!



If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



20201123-1.png (7.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MotoX80 avatar image
0 Votes"
MotoX80 answered

From I've been able to determine, you would need to set your phone to connect in MSC mode. That way it will appear as a USB drive to your pc.

https://docs.microsoft.com/en-us/archive/blogs/jamesone/on-scanners-cameras-and-their-usb-modes-and-lifting-the-lid-on-how-they-can-be-scripted

On my Motorola G5 it had USB options to "Transfer files" and "Transfer Photos (PTP)". I set my phone to "Transfer files", and I saw that it was using the MTP driver. I found these software products that appear (I have not tested) to make the phone visible as a drive letter.

https://ptpdrive.com/index.html
https://www.mtpdrive.com/

To access "This PC", it appears that you would need to use the Shell.Application COM object. Here is a Powershell script that uses that to copy files from your phone. You can modify that to suite your needs.

https://github.com/nosalan/powershell-mtp-file-transfer

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.