Skip to content

Instantly share code, notes, and snippets.

@nagarindkx
Created May 21, 2021 16:12
Show Gist options
  • Save nagarindkx/70f254a21c5cad7f964e762ab8b2e733 to your computer and use it in GitHub Desktop.
Save nagarindkx/70f254a21c5cad7f964e762ab8b2e733 to your computer and use it in GitHub Desktop.
Move large amount of files from a single Google Drive folder to Shared Drives
function moveFilesFromDriveToShareDrive() {
/*
Created by: Kanakorn Horsiritham
Digital Innovation and Data Analytics (DIDA)
Faculty of Medicine
Prince of Songkla University
Hatyai, Songkhla
THAILAND
*/
sourceFS=DriveApp.getFolderById('GoogleDrive-Folder-ID').getFiles()
destinationFS=DriveApp.getFolderById('SharedDrives-Folder-ID')
while(sourceFS.hasNext()){
f=sourceFS.next()
f.moveTo(destinationFS)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment