Solved

powershell command to copy and paste files

Posted on 2015-01-04
4
442 Views
Last Modified: 2015-01-04
I have a folder with multiple folders and sub-folders in those folders.
there are mp3 files in all of the folders underneath my main folder called music.

can i get cmd syntax for powershell to copy all mp3 files under the folder music and its subfolders and then paste it in a folder called music1 under c drive
0
Comment
Question by:jamesmetcalf74
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 70

Expert Comment

by:Qlemo
ID: 40530629
Do you want to have the same folder structure in the destination, or have all files in a single folder?
0
 

Author Comment

by:jamesmetcalf74
ID: 40530853
single folder
0
 
LVL 40

Accepted Solution

by:
footech earned 500 total points
ID: 40530897
The following should do what you want.  You can change the paths as appropriate.
Get-ChildItem -Path c:\music -filter *.mp3 -recurse | Copy-Item -Destination c:\music1

Open in new window

0
 

Author Closing Comment

by:jamesmetcalf74
ID: 40530907
that did the trick
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question