rootsdigger05 Posted August 26, 2021 Share Posted August 26, 2021 Environment: Windows 10 laptop with connected Android phone (Android 11) I am trying to copy some .wav files from my connected Android phone: filecopy("This PC\Galaxy A42 5G\Phone\Android\data\com.Chillseekers.MiracleBox\files\*.wav", "C:\Users\BLAH\Documents\The Miracle Box\",$FC_OVERWRITE) but the source location is not recognized. How do I properly identify the source? Please note: I have already tried changing the save location of .wav files to sd card, but that functionality does not work in the app that creates the .wav files. Link to comment Share on other sites More sharing options...
Developers Jos Posted August 26, 2021 Developers Share Posted August 26, 2021 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Solution Nine Posted August 26, 2021 Solution Share Posted August 26, 2021 You cannot use this approach to copy files from Android to you PC. As well described : https://superuser.com/questions/1281989/not-able-to-access-path-of-mobile-phone-in-cmd https://android.stackexchange.com/questions/57429/open-command-prompt-to-access-folders-of-a-usb-connected-android-phone However you can use a Shell.Application object to perform such a task. Here my code to copy all *.jpg from phone to computer. (Note that copyHere has multiple flags that you can set. Search MSDN for a list.) expandcollapse popup#include <Constants.au3> #include <File.au3> Opt("MustDeclareVars", 1) Local $oShellApplication = ObjCreate("Shell.Application") Local $oShellFolder = $oShellApplication.NameSpace(17) ; drives Local $oShellFolderItems = $oShellFolder.Items() For $oFolder in $oShellFolderItems ConsoleWrite ($oFolder.name & @CRLF) If $oFolder.name = "Moto G Play" Then ExitLoop Next Local $oRoot = $oFolder.GetFolder Local $oRootItems = $oRoot.Items() For $oSource in $oRootItems ConsoleWrite ($oSource.name & @CRLF) If $oSource.name = "Carte SD" Then ExitLoop Next $oRoot = $oSource.GetFolder $oRootItems = $oRoot.Items() For $oSource in $oRootItems ConsoleWrite ($oSource.name & @CRLF) If $oSource.name = "DCIM" Then ExitLoop Next $oRoot = $oSource.GetFolder $oRootItems = $oRoot.Items() For $oSource in $oRootItems ConsoleWrite ($oSource.name & @CRLF) If $oSource.name = "Camera" Then ExitLoop Next $oRoot = $oSource.GetFolder $oRootItems = $oRoot.Items() Local $sDrive, $sDir, $sFileName, $sExtension Local $oDestination = $oShellApplication.NameSpace("C:\Apps\Temp") For $oSource in $oRootItems _PathSplit($oSource.name, $sDrive, $sDir, $sFileName, $sExtension) If $sExtension = ".jpg" Then $oDestination.CopyHere($oSource) ConsoleWrite ("Copied " & $oSource.name & "/" & $oRoot.GetDetailsOf ($oSource,2) & @CRLF) EndIf Next rootsdigger05 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
rootsdigger05 Posted August 27, 2021 Author Share Posted August 27, 2021 Nine, thank you very much for posting a reply, but can you please explain exactly what your code does so that I might be able to adapt it to my situation/environment? Link to comment Share on other sites More sharing options...
Nine Posted August 27, 2021 Share Posted August 27, 2021 (edited) Just replace the name of the various components to yours. For example "Mota G Play" is the name of my phone. Replace with yours : "Galaxy A42 5G". Follow the path of the directory tree of yours. Edited August 27, 2021 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
rootsdigger05 Posted August 27, 2021 Author Share Posted August 27, 2021 Ok, thanks for the clarification about the device name. However, I do not need to recurse through the entire file system for every .wav file. I only need to copy *.wav from one folder. Link to comment Share on other sites More sharing options...
rootsdigger05 Posted August 27, 2021 Author Share Posted August 27, 2021 I re-read your code and now understand how it works. And implemented it for my phone file structure - BOOM! Worked PERFECTLY! Thank you! Thank you! Thank you! Link to comment Share on other sites More sharing options...
Nine Posted August 27, 2021 Share Posted August 27, 2021 Great. Please mark it as solved. Thanks. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now