Last active
April 13, 2016 13:11
-
-
Save hamsterbacke23/f7494fdb15aa1d1fd12a584bb7004da9 to your computer and use it in GitHub Desktop.
copypaste.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define source and target folders | |
$source = 'U:\Fromfolder' | |
$dest = 'Q:\TargetFolder' | |
# Exclude folders and file types here | |
$excludeDirs = @('\exclude me please folder') | |
$excludeFileString = '*.DS_Store Thumbs.db' | |
$excludeDirString = ''; | |
for ($i=0; $i -lt $excludeDirs.length; $i++) { | |
$excludeDirString = $excludeDirString + ' "' + $source + $excludeDirs[$i] + '" ' | |
} | |
$cmdString = '"' + $source + '" "' + $dest + '"' + ' /XD ' + $excludeDirString + ' /XF ' + $excludeFileString + ' /IS /COPY:D' | |
Write-Host $cmdString; | |
robocopy $cmdString; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment