• Home
  • News
  • Key Concepts
  • How To
  • Windows
  • Apple
  • Android
  • Best-Of
  • Reviews

IT4nextgen

Tech Tutorials and Reviews

IT4nextgen > How To > How to Create Multiple Sub-folders in Google Drive Automatically with a Script

How to Create Multiple Sub-folders in Google Drive Automatically with a Script

Last Updated January 13, 2025 By Subhash D Leave a Comment

Google Drive is an excellent tool for storing and organizing files, but creating multiple sub-folders manually can be time-consuming, especially for large projects. Thankfully, there are ways to automate this process. In this guide, we’ll walk you through how to create multiple sub-folders in Google Drive automatically using Google Apps Script, complete with screenshots.

Step 1: Access Google Apps Script

1. Open Google Drive:

  • Go to Google Drive.
  • Click on the “New” button on the left-hand side and select “Google Sheets” from the dropdown menu.

2. Open Apps Script Editor:

  • In your new Google Sheet, click on Extensions in the menu bar.
  • Select Apps Script from the dropdown.

Step 2: Write the Script

3. Create the Script:

  • In the Apps Script editor, delete any code that is already there.
  • Copy and paste the following script:
  • Replace 'YOUR_PARENT_FOLDER_ID' with the ID of the parent folder where you want to create the subfolders. You can get this ID from the URL of the folder.

4. Save and Run the Script:

  • Click on the disk icon to save your script. Name it something meaningful, like CreateSubFolders.
  • Click on the run icon (a triangle) to execute the script.

Step 3: Authorize the Script

5. Grant Permissions:

  • The first time you run the script, you will need to authorize it to access your Google Drive.
  • Click on the “Review Permissions” button, select your Google account, and click on “Allow“.

Step 4: Verify the Sub-Folders

6. Check Your Google Drive:

  • Go back to your Google Drive and open the parent folder.
  • You should now see the sub-folders created as specified in the script.

Customizing the Script

7. Add More Sub-folders:

  • To create more sub-folders, simply add their names to the subfolders array in the script.
 

8. Dynamic Folder Names:

  • You can also generate folder names dynamically based on other criteria, such as dates or user input.

Conclusion

Using Google Apps Script to create multiple sub-folders in Google Drive automatically can save you a significant amount of time and effort. This method is especially useful for organizing large projects or managing repetitive tasks. With just a few lines of code, you can automate your workflow and enhance your productivity.

By following the steps outlined in this guide, you can easily set up your Google Drive to create sub-folders automatically, ensuring that your files are always well-organized and easy to find. Happy organizing!

EXPLORE MORE

  • track-google-contacts-on-google-map
    How to Locate your Contacts on Google Map with Chrome App
  • send-large-files-in-gmail
    How to Send Large Files through Gmail with Google Drive
  • google-photos
    Google Photos: More than Image Hosting Service
  • google maps
    This Company Turns Your Google Trips Into A Mileage…

Filed Under: How To

About Subhash D

A tech-enthusiast, Subhash is a Graduate Engineer and Microsoft Certified Systems Engineer. Founder of it4nextgen, he has spent more than 20 years in the IT industry.

Share Your Views: Cancel reply

Latest News

autonomous mobile robots

AI Agents Are Finally Getting Real in 2026 (And Most Companies Still Aren’t Ready)

AI mode updates

New Google Search AI Tools: PDFs, Canvas, and Real-Time Help Explained

Apple SE phone

Upcoming iPhone SE 4: All You Need to Know

Gemini 2.0

Gemini 2.0: A New Era in AI with Flash, Pro, and Flash-Lite Models

apple-vision-pro

What’s so ‘Pro’ About Apple Vision Pro Headset

  • About Us
  • Privacy Policy and Disclaimer
  • Contact Us
  • Advertise
  • Newsletter!
  • Facebook
  • LinkedIn
  • Twitter

Enjoy Free Tips & News

Copyright © 2026 IT4Nextgen.com