Dana

acces files on smartphone via usb?

7 posts in this topic

I'm working on a script intended to work with files stored on my [android 5.1] smartphone.  Problem is, I can't get a valid path.  If I plug in the phone, Windows sees it, I can view and manipulate files, and Explorer says the path is, for example, Computer\XT1254\Internal storage\Music.  However, if I try to access it with AutoIT, e.g.:

$path = FileSelectFolder("Select folder for music files", "")
If @error Then Exit
ConsoleWrite($path & @crlf)
$filelist = _FileListToArrayRec($path, "*.mp3;*.wma", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH)

I get

::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2ea4#zx1f42cdvh#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,56161665024}\{00000001-0001-0001-0000-000000000000}

for $path (the first ConsoleWrite), and _FileListToArrayRec returns extended error 1 (Path not found or invalid).

Is there any way to access files on such a device?  There doesn't seem any to get Windows to assign a drive letter to it like it did with my old phones.  There do seem to be some ways to do it involving setting up the android device as a server but I was hoping for a simpler solution using USB.

Share this post


Link to post
Share on other sites



The path for it is:

::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2ea4#zx1f42cdvh#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\

You can paste that in any window, and it will put you on the smartphone dir.

As for the function to work, idk, maybe it doesn't assume a path like that.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

Well, Windows may accept that, but _FileListToArrayRec does not.

Share this post


Link to post
Share on other sites

Explore the the registry, there must be a way how Explorer knows  how Computer\XT1254\Internal storage\Music <==> ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2ea4#zx1f42cdvh#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,56161665024}\{00000001-0001-0001-0000-000000000000} correspending.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Dana,

Try using this as the path in _FileToArrayRec:

\\?\usb#vid_22b8&pid_2ea4#zx1f42cdvh#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\

M23

Edited by Melba23
Typo

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

I looked in the registry, XT1254 shows up numerous places, and at least one of them has part of the string returned by FileSelectFolder:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\KnownDevices\WpdDeviceHandler_USB#VID_22B8&PID_2EA4#ZX1F42CDVH]
"Label"="XT1254"
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\
  00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,77,00,\
  70,00,64,00,73,00,68,00,65,00,78,00,74,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,\
  00,37,00,30,00,34,00,00,00

More interesting was this one:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Portable Devices\Devices\USB#VID_22B8&PID_2EA4#ZX1F42CDVH]
"FriendlyName"="XT1254"

I changed FriendlyName to "Z:\", and now typing Z: in windows explorer takes me to the device... but _FileListToArrayRec still doesn't like it.

 

M23, I tried that, along with other combinations and subsets, no joy anywhere.

Share this post


Link to post
Share on other sites

Have you tried the Android UDF?  I haven't used it, but it may help you.  

 

Adam

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now