Desktop path Windows 10 command prompt

JakeSokol-9687 asked Nov 22, '20 | MotoX80 answered Nov 23, '20

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-general
Comment
Comment Show 0
Comment
5 |1600 characters needed characters left characters exceeded
  • Visible to all users
  • Visible to the original poster & Microsoft
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Visible to all users

Attachments: Up to 10 attachments [including images] can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RitaHan-MSFT answered Nov 23, '20

Hello @JakeSokol-9687,

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

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 ourdocumentationto enable e-mail notifications if you want to receive the related email notification for this thread.



20201123-1.png [7.0 KiB]
Comment
Comment Show 0
Comment
5 |1600 characters needed characters left characters exceeded
  • Visible to all users
  • Visible to the original poster & Microsoft
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Visible to all users

Attachments: Up to 10 attachments [including images] can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MotoX80 answered Nov 23, '20

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.

//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.

//ptpdrive.com/index.html
//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.

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

Comment
Comment Show 0
Comment
5 |1600 characters needed characters left characters exceeded
  • Visible to all users
  • Visible to the original poster & Microsoft
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Visible to all users

Attachments: Up to 10 attachments [including images] can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Video liên quan

Chủ Đề