GAS Library - MoveFolder


This is a Google Apps Script library for moving a folder including files and folders on Google Drive.


This library addresses a common challenge: efficiently moving folders, including their subfolders and files, between Google Drives. This encompasses both personal and shared drives using a script. While Google Drive offers straightforward methods for moving individual files between any drives, directly moving entire folders containing subfolders presents limitations, particularly when shared drives are involved. This script bridges that gap by providing a reliable Google Apps Script solution for such scenarios.

Seeing a need, I created this script after receiving several requests. I believe it could be useful for other users, so I published it. If you find this helpful, I’m glad!

IMPORTANT: Please read this before you test

  • This script automates moving folders and files within your Google Drive, including those in shared drives. Use caution when running the script, as it will modify your file structure.
  • For safe testing, create a sample folder and populate it with some files. If you have a large number of folders and files, consider splitting them into smaller groups for individual testing. Unfortunately, limitations in my environment prevent me from comprehensively testing the script with massive amounts of data.
  • Please note that we cannot assume any responsibility or liability for any damage or loss caused by this script. Use it at your own risk.

Library’s project key


You can see the detail information here