Copy a single folder to multiple folders?
Copy a file to multiple folders?
This can be done easily using PowerShell script.
Script below requires PS 3.0, but it can easily be tweak for other version.
Here's the script:
#++++++++++++++++++++++++++++++
$source_folder="D:\xfolder\United Folders"
dir -Directory "D:\Unity\Project_016\" | ForEach-Object {
write-host $_.fullname
Copy-Item -Path $source_folder -Destination $_.FullName
}
#++++++++++++++++++++++++++++++
What the script does is the $source_folder is to be copied to all folders in the destination.
Basically, the "United Folders" is to be copied to the root of the sub folder in destination folder which is "D:\Unity\Project_016\".
Example:
D:\Unity\Project_016\01
D:\Unity\Project_016\02
D:\Unity\Project_016\03
After executing the script, the folders will look like this:
D:\Unity\Project_016\01\United Folders
D:\Unity\Project_016\02\United Folders
D:\Unity\Project_016\03\United Folders
It depends on how many sub folders are there in the destination, the source folder will be copied into it.
To copy a file, just change the statement to this line below:
$source_folder="D:\xfolder\United Folders\file16.docx"
Before rolling out to production do a test, to make sure it is what you expected.
Cheers! Hope it helps, till next time.
Copy a file to multiple folders?
This can be done easily using PowerShell script.
Script below requires PS 3.0, but it can easily be tweak for other version.
Here's the script:
#++++++++++++++++++++++++++++++
$source_folder="D:\xfolder\United Folders"
dir -Directory "D:\Unity\Project_016\" | ForEach-Object {
write-host $_.fullname
Copy-Item -Path $source_folder -Destination $_.FullName
}
#++++++++++++++++++++++++++++++
What the script does is the $source_folder is to be copied to all folders in the destination.
Basically, the "United Folders" is to be copied to the root of the sub folder in destination folder which is "D:\Unity\Project_016\".
Example:
D:\Unity\Project_016\01
D:\Unity\Project_016\02
D:\Unity\Project_016\03
After executing the script, the folders will look like this:
D:\Unity\Project_016\01\United Folders
D:\Unity\Project_016\02\United Folders
D:\Unity\Project_016\03\United Folders
It depends on how many sub folders are there in the destination, the source folder will be copied into it.
To copy a file, just change the statement to this line below:
$source_folder="D:\xfolder\United Folders\file16.docx"
Before rolling out to production do a test, to make sure it is what you expected.
Cheers! Hope it helps, till next time.
================================
Free Android Apps:
Click on links below to find out more:
Linux Android App cheat sheet:
Multiplication Table for early learners
Catholic Rosary Guide for Android:
Divine Mercy Chaplet Guide (A Powerful prayer):
Comments
Post a Comment