Aligning Files & Directories in Modern Windows

Aligning Files & Directories in Modern Windows

David Lv13

Aligning Files & Directories in Modern Windows

Folder merging in Windows is an excellent file management idea to organize folders with similar files into one big folder. This helps avoid clutter and offers everything in one place, thus making it easier to find what you are looking for.

That said, by default, Windows has no option to merge folders. Even though it is clever enough to identify multiple folders of the identical name at the same level, there are more efficient ways to merge folders and files in Windows 10 and 11.

Here we show you the best ways to merge folders on a Windows 10 and 11 system. It includes the convenient File Explorer merge option, a PowerShell script hack and third-party tools to merge folders.

1. Merge Folders Using File Explorer

confirm folder replace merge folder file explorer

File Explorer will detect and prompt you to merge the folder when you try to move a folder with a name identical to an existing folder at the same level.

For example, if you have anXYZ folder inD:\Folders and want to merge theXYX folder in the same level, all you have to do is rename theXYX folder asXYZ . When theConfirm Folder Replace prompt appears, clickYes .

Similarly, you can cut and paste the folder with identical names and then opt for the merge option. File Explorer will merge the folders and move the contents to the destination folder. If a duplicate file exists, you can opt for theReplace orSkip option.

Conversely, this can be a time-consuming process when you have to work with hundreds of folders at a time. A more efficient way to overcome this limitation is to use a PowerShell script hack to merge folders on Windows.

2. Merge Folders Using a PowerShell Script

PowerShell is a powerful automation shell utility. You can learn the essential PowerShell cmdlets to automate everyday tasks with a script.

Similarly, you can use a PowerShell script to merge folders in Windows 10 and 11. This is a handy way to merge multiple folders without copying and pasting them one by one.

To use the script, you must enable running scripts in Windows PowerShell. Once done, you can copy and paste the script directly onto the PowerShell window without having to run it as a .ps1 file.

To allow the local PowerShell script to Run, you’ll need to change the execution policy in the Settings app. Here’s how to do it.

enable powershell to run local scripts

  1. PressWin + I to open theSettings app.
  2. Next, open thePrivacy & security tab in the left pane.
  3. Click onFor Developer under theSecurity section .
  4. Next, scroll down and click to expand thePowerShell section.
  5. Toggle the switch to turn on Change execution policy to allow local PowerShell scripts to run without signing .Require signing for remote scripts .

With the script running on PowerShell enabled, follow these to execute a PowerShell script to merge folders.

merge folders powershell

  1. Press theWin key and typepowershell .
  2. Click onWindows PowerShell from the search results.
  3. Copy and paste the following script in the PowerShell window:
    $sourcePath = "F:\New folder" $destinationPath = "E:\New folder" $files = Get-ChildItem -Path $sourcePath -Recurse -Filter "*.*" foreach($file in $files){     $sourcePathFile = $file.FullName     $destinationPathFile = $file.FullName.Replace($sourcePath, $destinationPath)     $exists = Test-Path $destinationPathFile     if(!$exists){         $dir = Split-Path -parent $destinationPathFile         if (!(Test-Path($dir))) { New-Item -ItemType directory -Path $dir }         Copy-Item -Path $sourcePathFile -Destination $destinationPathFile -Recurse -Force     }     else{         $isFile = Test-Path -Path $destinationPathFile -PathType Leaf         if(!$isFile){             Copy-Item -Path $sourcePathFile -Destination $destinationPathFile -Recurse -Force         }     } }
  4. In the above command, replace “E:\New folder ” and “F:\New folder ” with the source and destination file paths, respectively. To find the file path, right-click on the folder name you want to merge and selectCopy as the path.
  5. The above command will merge the contents of theE:\New folder with theF:\New folder . It will skip any duplicate file conflict to leave the original files in the destination folder unaffected.

You can repeat the script with different file paths to merge more folders. If you encounter any error, check if the file path for the destination and source is correct.

2. Merge Folders Using Third-Party Software

If you prefer a GUI-based utility over a PowerShell script to merge files, you have a few options to choose from. Third-party merge tools for Windows offer basic merging capabilities and premium offerings catered to software and creative design professionals.

1. Folder Merger

folder merger windows

Folder Merger is a free utility to merge the contents of different folders into a single folder. You can add multiple source folders to the app and then merge them to a specified destination folder.

Using Folder Merger is easy. You can add a single folder or select a root folder to add first-level subfolders. Next, click theDestination folder icon to set the destination folder.

Once all the folders are added, clickSelect All to merge all the folders or individual folders using theCtrl key. Click theMerge button to begin the merging process. Once done, click the Show folder icon in theDestination section to view your newly merged files.

In addition, you can also choose to copy or move the files, merge files of a specific name or extension, and resolve file conflict with the skip, replace or rename option.

Download :Folder Merger (Free)

2. WinMerge

winmerge file difference comparison

WinMerge serves a different purpose than Folder Merger with a clean user interface. It is an open-source differencing and merger utility for Windows. A handy tool if you want to compare multiple text documents to find the differences. It can compare text-based documents, images, web pages, and more from a folder for differences and then perform a merge.

To compare and merge documents using WinMerge:

  1. Click onFile and selectOpen .
  2. Select the first file or folder and then the second file or folder. You can select up to three files or folders to cross-compare.
  3. ClickCompare to load and compare the files.
  4. If it is a text file, WinMerge will highlight the difference within lines between the selected documents.
  5. To merge individual changes in the document, click on the highlighted text and selectCopy from right orCopy to right , depending on which version you want to merge.
  6. To merge all the changes, pressCtrl + A to select all the text and then use the copy option. It also supports difference comparison for images, web pages, binary files and tables.

In addition, it features support for shell integration, good plugin and archive file support with 7-Zip.

Download :WinMerge (Free)

Glarysoft File Recovery Pro - Helps to recover your lost file/data, even permanently deleted data.

The Best Apps to Merge Files and Folders on Windows

Windows 11 can detect and prompt copied folders in the same level to be merged. However, if you need to work with multiple folders frequently, a PowerShell script or a GUI-based tool like Folder Merger makes the task much easier.

  • Title: Aligning Files & Directories in Modern Windows
  • Author: David
  • Created at : 2024-08-16 00:18:52
  • Updated at : 2024-08-17 00:18:52
  • Link: https://win11.techidaily.com/aligning-files-and-directories-in-modern-windows/
  • License: This work is licensed under CC BY-NC-SA 4.0.