{"id":8216,"date":"2025-02-25T21:02:23","date_gmt":"2025-02-25T15:32:23","guid":{"rendered":"https:\/\/www.conceptworld.com\/blog\/?p=8216"},"modified":"2025-03-04T22:44:42","modified_gmt":"2025-03-04T17:14:42","slug":"exclude-specific-folders-when-copying-files-in-windows-using-powershell-alternative-replacement","status":"publish","type":"post","link":"https:\/\/www.conceptworld.com\/blog\/index.php\/exclude-specific-folders-when-copying-files-in-windows-using-powershell-alternative-replacement\/","title":{"rendered":"Exclude specific folders when copying files in Windows using PowerShell alternative replacement"},"content":{"rendered":"\n<p>Hey Guys! Copying files while excluding specific folders can be a challenge if you\u2019re using standard Windows copy commands. Here we will look at this feature using <strong> PowerShell<\/strong> and an <strong> alternative software<\/strong>, <a rel=\"noopener noreferrer\" href=\"https:\/\/www.conceptworld.com\/copywhiz\" target=\"_blank\">Copywhiz<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Copywhiz?<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.conceptworld.com\/Copywhiz\" data-type=\"link\" data-id=\"https:\/\/www.conceptworld.com\/Copywhiz\" target=\"_blank\" rel=\"noreferrer noopener\">Copywhiz<\/a> enhances your file-copy experience by letting you to have more flexibility &amp; control over the file copying and backup process. <\/p>\n\n\n\n<p>Here is how <a href=\"https:\/\/www.conceptworld.com\/Copywhiz\" data-type=\"link\" data-id=\"https:\/\/www.conceptworld.com\/Copywhiz\" target=\"_blank\" rel=\"noreferrer noopener\">Copywhiz<\/a> makes file copying a breeze: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Copy only new or modified files<\/li>\n\n\n\n<li>Easily pick files by name, extension, folder etc from bunch of folders<\/li>\n\n\n\n<li>Automatically organize files based on file attributes and metadata<\/li>\n\n\n\n<li>Copy files to multiple folders\/computers<\/li>\n\n\n\n<li>Copy files from multiple folders and paste them at once<\/li>\n\n\n\n<li>Sync files between source and destination<\/li>\n\n\n\n<li>Pick files from multiple folders and compress in single .zip file<\/li>\n\n\n\n<li>Schedule file backups<\/li>\n\n\n\n<li>Verify copied files for data integrity<\/li>\n\n\n\n<li>Retain security attributes of files &amp; folders (ownership\/user access)<\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.conceptworld.com\/Copywhiz\/Features\" target=\"_blank\">Several more hidden nuggets<\/a>&nbsp;designed to make your file-copy task easier.<\/li>\n<\/ul>\n\n\n\n<p>First we will check out this feature using Copywhiz. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Copywhiz:<\/h2>\n\n\n\n<p>Watch a short video depicting this feature:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Windows: Exclude specific folders when copying files using Copywhiz\" width=\"660\" height=\"371\" src=\"https:\/\/www.youtube.com\/embed\/YZH3tdsmI6Y?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Video Transcription<\/h2>\n\n\n\n<p>1. Select files using Windows Explorer, right-click on them and choose Copywhiz-&gt;Copy from the menu as shown below :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.conceptworld.com\/blog\/uploads\/2016\/09\/Copy-Files.jpg\"><img decoding=\"async\" width=\"600\" height=\"525\" src=\"https:\/\/www.conceptworld.com\/blog\/uploads\/2016\/09\/Copy-Files.jpg\" alt=\"\" class=\"wp-image-2647\" srcset=\"https:\/\/www.conceptworld.com\/blog\/uploads\/2016\/09\/Copy-Files.jpg 600w, https:\/\/www.conceptworld.com\/blog\/uploads\/2016\/09\/Copy-Files-300x262.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/figure><\/div>\n\n\n<p>2. Go to the destination folder, right-click inside the folder and select Copywhiz\u2013&gt;Paste special\u2013&gt;Paste files by name or type as shown below:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.conceptworld.com\/blog\/uploads\/2016\/09\/Paste-Special-Menu.jpg\"><img decoding=\"async\" width=\"600\" height=\"525\" src=\"https:\/\/www.conceptworld.com\/blog\/uploads\/2016\/09\/Paste-Special-Menu.jpg\" alt=\"\" class=\"wp-image-2654\" srcset=\"https:\/\/www.conceptworld.com\/blog\/uploads\/2016\/09\/Paste-Special-Menu.jpg 600w, https:\/\/www.conceptworld.com\/blog\/uploads\/2016\/09\/Paste-Special-Menu-300x262.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/figure><\/div>\n\n\n<p>3. The Advanced Settings dialog box will open. You can include or exclude files\/folders to be copied by typing their names, file extensions, or folder names. You can also preview the list of files that will be copied and files that will be skipped by clicking on the Preview button. After confirming, press the Ok button in the Advanced Settings dialog box. All the required files will be copied successfully.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"450\" height=\"550\" src=\"https:\/\/www.conceptworld.com\/blog\/uploads\/2018\/06\/Screenshot-Exclude-Files.png\" alt=\"Screenshot-Exclude-Files\" class=\"wp-image-4904\" srcset=\"https:\/\/www.conceptworld.com\/blog\/uploads\/2018\/06\/Screenshot-Exclude-Files.png 450w, https:\/\/www.conceptworld.com\/blog\/uploads\/2018\/06\/Screenshot-Exclude-Files-245x300.png 245w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Using PowerShell: <\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Open PowerShell<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Press <code>Win + X<\/code> and select <strong>PowerShell (Admin)<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Run Robocopy with Exclusion Parameters<\/strong><\/h3>\n\n\n\n<p>Run the following command:<\/p>\n\n\n\n<p>powershell<\/p>\n\n\n\n<p>CopyEdit<\/p>\n\n\n\n<p><code>robocopy \"C:\\Source\" \"D:\\Destination\" \/E \/XD \"C:\\Source\\ExcludeFolder1\" \"C:\\Source\\ExcludeFolder2\"<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Explanation of Parameters:<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\"C:\\Source\"<\/code> ? Source folder.<\/li>\n\n\n\n<li><code>\"D:\\Destination\"<\/code> ? Destination folder.<\/li>\n\n\n\n<li><code>\/E<\/code> ? Copies all subdirectories, including empty ones.<\/li>\n\n\n\n<li><code>\/XD<\/code> ? Excludes specific directories.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Automate with a PowerShell Script<\/strong><\/h3>\n\n\n\n<p>If you frequently need to copy files with exclusions, use this script:<\/p>\n\n\n\n<p>powershell<\/p>\n\n\n\n<p>CopyEdit<\/p>\n\n\n\n<p><code># Define source and destination $source = \"C:\\Source\" $destination = \"D:\\Destination\" # Define folders to exclude $excludeFolders = @(\"ExcludeFolder1\", \"ExcludeFolder2\") # Convert to robocopy \/XD format $excludeParams = $excludeFolders -join '\" \"' # Construct robocopy command $robocopyCmd = \"robocopy `\"$source`\" `\"$destination`\" \/E \/XD `\"$excludeParams`\"\" # Execute command Invoke-Expression $robocopyCmd Write-Output \"Copy operation completed successfully!\"<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.conceptworld.com\/copywhiz\" target=\"_blank\" rel=\"noopener noreferrer\">Copywhiz<\/a> lets you to choose which type of files to copy &amp; which to ignore i.e, it lets you to do &#8216;Selective File Copy&#8217;.<\/p>\n\n\n\n<p>Pick only those files that are important &amp; avoid files that are not required (Eg. Files that occupy too much space) with Copywhiz. Easily filter files by name, extension, folder, etc. from a bunch of folders.<\/p>\n\n\n\n<p>Complete big file copy tasks with few clicks &amp; save manual effort with Copywhiz.<\/p>\n\n\n\n<p>For more tutorial videos, click <a title=\"Copywhiz Tutorial Videos\" rel=\"noopener noreferrer\" href=\"https:\/\/www.conceptworld.com\/Copywhiz\/Videos\" target=\"_blank\"> here <\/a>.<\/p>\n\n\n\n<p>Subscribe to our <a href=\"https:\/\/www.youtube.com\/channel\/UCULI5s6KJn-0iDIeqJRUWQA?view_as=subscriber\" target=\"_blank\" rel=\"noopener noreferrer\">YouTube channel<\/a> for regular updates and interesting videos!<\/p>\n\n\n\n<p><a href=\"https:\/\/www.conceptworld.com\/Copywhiz\" target=\"_blank\" rel=\"noopener noreferrer\">Learn more about<\/a> Copywhiz.<\/p>\n\n\n\n<p>Download the free trial <a href=\"https:\/\/www.conceptworld.com\/Copywhiz\/Download\">from here<\/a>.<\/p>\n\n\n\n<p>Check out our <a href=\"https:\/\/www.conceptworld.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">other cool products<\/a>.<\/p>\n\n\n\n<p>Have a good day.<\/p>\n\n\n\n<p>Thanks for reading till the end :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey Guys! Copying files while excluding specific folders can be a challenge if you\u2019re using standard Windows copy commands. Here we will look at this feature using PowerShell and an alternative software, Copywhiz. First we will check out this feature using Copywhiz. Using Copywhiz: Watch a short video depicting this feature: Video Transcription 1. Select &hellip; <a href=\"https:\/\/www.conceptworld.com\/blog\/index.php\/exclude-specific-folders-when-copying-files-in-windows-using-powershell-alternative-replacement\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Exclude specific folders when copying files in Windows using PowerShell alternative replacement<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-8216","post","type-post","status-publish","format-standard","hentry","category-copywhiz"],"_links":{"self":[{"href":"https:\/\/www.conceptworld.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/8216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.conceptworld.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.conceptworld.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.conceptworld.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.conceptworld.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=8216"}],"version-history":[{"count":2,"href":"https:\/\/www.conceptworld.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/8216\/revisions"}],"predecessor-version":[{"id":8248,"href":"https:\/\/www.conceptworld.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/8216\/revisions\/8248"}],"wp:attachment":[{"href":"https:\/\/www.conceptworld.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=8216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.conceptworld.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=8216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.conceptworld.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=8216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}