Home » How To » How to Use Batch File to Open Multiple Folders at Once Win 10

How to Use Batch File to Open Multiple Folders at Once Win 10

In Windows, you can create a simple batch script file to open multiple folders at once with a double-click or keyboard shortcut. Here’re the exact steps.

You can easily open the file explorer window using the Win + E keyboard shortcut and navigate to the folder you want to open.  Alternatively, you can pin frequently used folders to the taskbar. However, if you are constantly opening multiple directories, it is better to create a batch script to open folders at once. This reduces the repetitive work. For instance, every morning as soon as I start the system, I open three folders as part of my workflow. Though not a big deal, it is still a tedious job. So, I created a simple batch file that I execute as needed to open all folders at once.

In this quick and easy guide, let me share the steps to create a batch file to open multiple folders at once in Windows 10.

How to Create Batch File to Open Multiple Folders At Once

To open multiple folders at once, create the batch file using the script given below. Once created, double-click on the batch file to open the folders. Here’re the exact steps you should follow.

  1. First, go to the desktop in Windows 10.
  2. Right-click on the desktop.
  3. Select the “New → Text Document” option from the right-click menu.
    New-file-110820
  4. Name the text file as “OpenFolders.bat“. Make sure you replace the .txt extension with .bat.
  5. After creating the bat file, right-click on it and select “Edit“.
    Batch-file-to-open-multiple-folders-110820
  6. The bat file will be opened in the Notepad. Here paste the below code in it. Replace the dummy folder paths with the actual folder paths.
    @echo off
    start %SystemRoot%\explorer.exe "E:\dummy\path\to\folder1"
    start %SystemRoot%\explorer.exe "E:\dummy\path\to\folder2"
    start %SystemRoot%\explorer.exe "E:\dummy\path\to\folder3"
  7. To add more folders, duplicate the start line and add the folder path.
    Batch-script-to-open-multiple-folders-110820
  8. Press “Ctrl + S” or select “File → Save” to save the batch file.
  9. Close the Notepad window.

That is all. Whenever you want to open different folders at once, simply double-click on the batch file. It will open all the folders for you.

Add Keyboard Shortcut to Run Batch File

To make things a bit easier, you can add a keyboard shortcut to run the batch file. That way, you don’t have to specifically go to the desktop and click on the batch file. Pressing the keyboard shortcut from anywhere will execute the batch script to open the folders. To add the keybinding, we going to use the AutoHotKey.

  1. First, install AutoHotKey.
  2. Next, create a text file on the desktop and name it “OpenFolders.ahk”. It is important that you replace .txt with .ahk.
  3. Right-click on the file and select “Edit Script”.
  4. Copy and paste the below code in the opened file. Change the dummy path with the actual path of the batch file.
    ;Press Alt + R
    !R::
    Run, "C:\Users\Username\Desktop\OpenFolders.bat"
    return
  5. Save the file with Ctrl + S shortcut.
  6. Close the Notepad.
  7. Double-click on the .ahk file you just created.

That is all. From now on, whenever you want to open different folders at once, press the Alt + R keyboard shortcut. If you want to, you can customize the keyboard shortcut. Take a look at the AutoHotKey documentation to know how to set the key combinations.

I hope that helps. If you are stuck or need some help, comment below and I will try to help as much as possible.

2 thoughts on “How to Use Batch File to Open Multiple Folders at Once Win 10”

  1. Avatar for Jim Miller

    Hello, I use several programs among 3 Windows User and Local Profiles on my PC which are stored in the DropBox and One Drive folders. Can a batch file open a program stored in DropBox or One Drive? Thanks

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top