hst125fan / mtpmount

Mounts Media Transfer Protocol (MTP) devices as (removable) drives on Windows for access via command line.
Other
51 stars 14 forks source link

Drive does not appear after mounting #1

Open skyhighguyy opened 3 years ago

skyhighguyy commented 3 years ago

This application is exactly what I've been searching for, unfortunately I'm having an issue getting it to work. I have the latest version of Doken installed which is 1.4.0.1000. My machine is Windows 10 and I'm trying to mount an Apple iPhone to a drive letter. It shows up when I have mtpmount shows available drives, and after it mounts it states:

Drive Y:\ is now Apple iPhone\Internal Storage. Don't forget to unmount the drive (using unmount command) before disconnecting your device

Unfortunately Windows explorer doesn't show a drive Y:\, nor does disk management. What could I be doing wrong?

nikbackm commented 3 years ago

Similar problem for me.

Well, the mapped drive does show up in Explorer, but it does not contain all files even though they are all available in Explorer in the "Apple iPhone" map point that Windows creates.

Edit: Got it working after rebooting the computer. Seems that the first debug build of mtpmount.exe was left running, and might have conflicted with later release builds? At least I can list all files now when using my customized (*) release build.

(*) I changed it to show the real creation times and not only the modified times as I use mtpmount to get the real creation timestamps of my photos, since Windows Explorer only copies the modified timestamp.

tarchive commented 3 years ago

Indeed an issue exists. I can run the command and it mounts the iPhone successfully to letter Y. I can then open explorer and browse all the files fine under Y. However nothing else program-wise seems to see that Y exists as a drive. For example if i open up cmd and type y: or dir y: i get the error The system could not find the path specified Also as mentioned in the original disk management / diskpart / mountvol also do not see any new device. I also tried \\localhost\y$ and nothing was found. I tried to turn on file sharing and still windows said The device or directory does not exist As expected at this point robocopy also gives error ERROR 3 Getting File System Type of Source Y:\ The system could not find the path specified

At this point i am thoroughly confused how one is suppose to use this program. It's obviously broken and seems like it does nothing different than the regular mtp device icon...

Please come back and revive this project. I would love to use robocopy in my script to backup my phone automatically.

Devices i tested with: Windows 10 1909 20h2v2 iPhone 8 and SE Doken 1.4.1.1000

All devices were rebooted several times and different data cables were tried.

EDIT: I think i figured out something key to this issue, Not sure how to fix it/work around it yet... The mounted mtp drive is only visible to the current session user. No system processes or services can see it. In the picture below the top cmd is my desktop user and the bottom is my elevated cmd. Notice only the regular user can see the drive. For some reason even calling robocopy or any command from the working cmd still results with file not found. Apparently running simple commands as your users still separates them to another process where the drive is not visible? You would also think the solution would be to mount the mtp drive with elevated cmd in the first place but i have tried and that does not give any different result. Still only local desktop user can see the drive, and no system/services can. I am still working on trying to setup a scheduled task as the desktop user but so far it is still not seeing the drive either... Still working on this though. Capture

Edit:Edit: Task scheduler tasks can only see the mtp drive when task is set to "Run only when user is logged in". This is NOT a solution and is frankly very annoying in my use case because all my logging is to text file so now there is a needless blank command prompt opening every time the task is run. If i select "Run whether user is logged in or not" and select hidden, the task now runs headlessly but will fail to see the mtp drive.

Can anyone submit a edit to this project to make the mpt drive work throughout windows? The author appears to have a excellent job with providing the source but i unfortunately am new to this and cannot wrap my head around it. Thank you.

Edit:Edit:Edit Okay, I got a workaround figured out! The issue is that mtpmount still runs in the background running as the first pid that called mtpmount list available even if the connection was closed/disconnected. You have to run taskkill /F /IM mtpmount-x64.exe(or whatever your exe is called) before every time you want to connect from a different session - regardless if its the same username or not.

Working procedure:

  1. taskkill /F /IM mtpmount-x64.exe - kill existing pids
  2. mtpmount-x64.exe list available - create new pid from current session
  3. mtpmount-x64.exe mount #0 - mount device

At this point you can run whatever commands you want. For example: y: - change to the mounted mtp device on whatever letter was specified. dir /a/s y: - list files and size of mtp device robocopy y:\ c:\mptDeviceBackup\ /E - make a backup of mpt device

Notice: The drive will NOT be visible in Explorer at this time! Only within the cmd that spawned the pid in step 2.