function mainCopyFolder() { var folderIdSrc = "フォルダID"; // コピー元のフォルダid var folderNameDest = "新フォルダ名"; // コピー先のフォルダ名 var folderSrc = DriveApp.getFolderById(folderIdSrc); var folderDest = folderSrc.getParents().next().createFolder(folderNameDest); copyFolder(folderSrc, folderDest); } function copyFolder(src, dest) { var folders = src.getFolders(); var files = src.getFiles(); while(files.hasNext()) { var file = files.next(); file.makeCopy(file.getName(), dest); } while(folders.hasNext()) { var subFolder = folders.next(); var folderName = subFolder.getName(); var copyFolder = dest.createFolder(folderName); copyFolder(subFolder, copyFolder); } }