New
#11
Multiple source directories and recursive? Okay:
Code:Get-ChildItem 'C:\source1', 'C:\folder\source2', 'C:\some\folder\source3' -Include '*.mp3' -Recurse | Copy-Item -Destination 'C:\destination'
I’m not sure what important fact you are desperately trying to point out to me.
Your method relies on the current directory for the starting path. True, you didn’t have to type out this path but this approach does not support multiple starting directories. Aside from this method, the starting paths most typically will have to be typed or how will the interpreter know where to begin looking?
I see your batch method is cute and all but I would think that entering a single line of code to get the job done is quite a lot more quicker than opening up a terminal to have a command redirect it’s output, then manually opening output file, make edits to it, execute it as a script, etc.
If this process is faster for you, by all means, speed is relative.
I know how your method works. If the OP wants the source location to be at the root folder I encourage him to do just that by using my line.
Code:Get-ChildItem 'D:\' -Include '*.mp3' -Recurse | Copy-Item -Destination 'C:\destination'
What you describe as the handling “multiple directories” is the recusing behaviour and this is a given need or it won’t be a valid solution to the problem. My command line recurses, does it not? And technically “cd \
” counts as typing a path.
thanks for the many responses to my original post. My flash drive is recognised by Windows 10 with appropriate icon in system tray but not seen in a command window therefore can't try a batch file. I open the command prompt as administrator and type E: and enter. It says "The system cannot find the file specified" Windows sees it but dos doesn't. Any help would be appreciated.
As this relates to music file, do you use a music manager? If so check if it has any functions to do what you want.
If not the music manager I use would do what you need without a problem do a search for MediaMonkey I use the Gold Version but the free version should allow you to list all the music files on the USB and you can then select all files right click and select "copy to" and navigate to your required location and all files will be copied for you.
It's late here now but will see what I can put together in step by step with screen shots in the morning here.
mediamonky handles my 30000+ track collection so should be OK for however many files you need to move now and in the future, plus a lot more
By 'icon in the system tray' do you mean the eject icon? On its own, that doesn't confirm that Windows has loaded the correct drivers for it. Try uninstalling it in Device Manager then reinsert the flash drive.
If a flash drive can be seen in File Explorer, it can be seen in a cmd.exe prompt (not Dos, that was for Win95/98). Can you see it in File Manager? If not, how does it appear in Disk Management? Does it have a drive letter assigned?