How to make a copy of a folder in Google Drive
How to make a copy of a folder in Google Drive
Google Drive lets you copy individual files with two clicks. Folders? Not so much. There's no native "Duplicate folder" option in the Drive UI — a gap that's persisted since Drive launched in 2012. If you need to know how to make a copy of a folder in Google Drive, you have three paths: manual file-by-file copying, a Google Apps Script that clones the folder structure programmatically, or an automated workflow that handles the entire process — nested subfolders, permissions, and all.
Google reported over 3 billion users across Google Workspace products in 2024. With that scale, folder duplication is a daily need for teams spinning up project templates, client onboarding packets, or quarterly report structures. CodeWords automates this with a single prompt to Cody: describe the source folder, the destination, and any permission changes you want applied to the copy.
Unlike generic AI automation posts, this guide shows real CodeWords workflows — not just theory.
TL;DR
- Google Drive has no native folder copy feature — you must use workarounds or automation
- Google Apps Script can recursively clone folder structures, but requires scripting knowledge and has execution time limits
- CodeWords automates the full copy, including nested folders, file permissions, and template variable replacement
Why doesn't Google Drive support folder copying natively?
The absence feels like an oversight, but there's engineering logic behind it. A folder in Google Drive is a metadata label, not a container in the traditional file-system sense. Files can live in multiple "folders" simultaneously. Copying a folder means duplicating every file reference, recreating the hierarchy, and deciding what happens with shared permissions — a blueprint that's harder to reproduce than it looks.
Google has addressed adjacent needs: Shared Drives support structured templates, and the Google Drive API exposes files.copy for individual files. But recursive folder duplication is left to developers. According to Google's Issue Tracker, folder copy has been a requested feature since 2013.
For occasional one-off copies, the manual approach works. For repeatable workflows — client onboarding, project kickoff, quarterly planning — you need automation.
How do you copy a folder manually?
The brute-force method:
- Open the source folder in Google Drive
- Select all files (Ctrl+A or Cmd+A)
- Right-click > Make a copy
- Move the copies into a new folder you've created
This works for flat folders with a handful of files. It breaks down when you have nested subfolders, because "Make a copy" doesn't preserve hierarchy. Copies land in the root of "My Drive" and need manual reorganization.
For folders with 10–20 files and no subfolders, this takes five minutes. For a deeply nested project template with 50+ files across multiple levels, it's an hour of tedious drag-and-drop. Permissions don't carry over either — each copy resets to "Only you" by default.
How do you clone a folder with Google Apps Script?
Apps Script gives you programmatic control. The following script recursively copies a folder and all its contents:
function copyFolder(sourceId, targetParentId) {
var source = DriveApp.getFolderById(sourceId);
var target = DriveApp.getFolderById(targetParentId)
.createFolder(source.getName() + ' (Copy)');
var files = source.getFiles();
while (files.hasNext()) {
var file = files.next();
file.makeCopy(file.getName(), target);
}
var subfolders = source.getFolders();
while (subfolders.hasNext()) {
var sub = subfolders.next();
copyFolder(sub.getId(), target.getId());
}
}
Run this from the Apps Script editor with the source and target folder IDs. It handles nested structures automatically through recursion.
Limitations to know:
- Execution time — Apps Script has a 6-minute execution limit (30 minutes for Workspace accounts). Large folders with hundreds of files may timeout.
- Permissions — copies inherit the target folder's sharing settings, not the source's. You'll need to re-apply permissions manually or via additional script logic.
- Quota — the Drive API allows 12,000 requests per day per user. A folder with 5,000 files exhausts nearly half your daily quota.
For a deeper look at Google Drive automation, see our Google Drive MCP Server guide.
How does CodeWords automate folder copying at scale?
CodeWords removes the scripting and quota management entirely. Tell Cody:
"Copy the folder 'Q2 Client Template' in my Google Drive to a new folder called 'Acme Corp Q3', including all subfolders. Apply read-only sharing with acme@example.com."
Cody generates a FastAPI workflow that:
- Authenticates via Google OAuth2 — reusing stored credentials from your CodeWords account
- Walks the folder tree using the Drive API v3
files.listendpoint with recursive query - Copies files in batches — respecting rate limits with built-in backoff
- Recreates the folder structure in the destination, preserving the hierarchy exactly
- Applies permissions per your specification — individual users, groups, or domain-wide access
The workflow handles edge cases that Apps Script doesn't: Google Docs/Sheets/Slides are copied as native files (not PDFs), shortcuts are resolved, and Google Forms embedded in the folder are duplicated with their response sheets.
For recurring use, turn it into a template. Every time you onboard a new client, fire the workflow with a different client name and email. Check available templates on the CodeWords templates page.
What about preserving permissions and metadata?
Permissions are the trickiest part of folder copying. Here's what to consider:
- Owner transfer — copied files are owned by whoever runs the script. You can't transfer ownership via API to external users.
- Viewer/editor sharing — use the Drive API's
permissions.createto replicate the source folder's sharing settings on the copy. CodeWords automates this through its 500+ integrations. - File metadata — descriptions, starred status, and custom properties don't carry over with
files.copy. You'll need separate API calls to replicate them.
If your folder template includes shared documents that multiple teams reference, consider using shortcuts instead of full copies for static reference files. Only copy files that each project actually modifies.
For teams managing large shared drives, the Google Workspace Admin SDK offers additional controls for bulk permission management. Pair this with a scheduled CodeWords job to audit and correct permission drift monthly.
How do you automate folder copying for project templates?
The most common use case for folder copying is project templates. A consulting firm might have a standard deliverable structure: proposals, contracts, work products, final reports — each in its own subfolder with placeholder files.
Build this as a parameterized CodeWords workflow:
- Input: client name, project type, team lead email
- Process: copy the template folder, rename the root to include the client name, replace placeholder text in Google Docs with client-specific values, share with the team lead
- Output: Slack notification with the new folder link
This turns a 30-minute manual setup into a 10-second automated operation. Zapier and Make can trigger on folder creation events but lack recursive copy and in-document text replacement. CodeWords handles the full pipeline because it generates actual Python code — not just API call chains.
Frequently asked questions
Can I copy a Shared Drive folder to My Drive?
Yes, but files in Shared Drives are owned by the organization, not individuals. Copies to My Drive create new files owned by you. Permissions from the Shared Drive don't carry over.
Is there a file count limit for automated copying?
The Google Drive API allows 12,000 queries per day per user. For folders with thousands of files, CodeWords uses batch requests and can split the copy across multiple days if needed.
Do Google Docs formatting and comments survive the copy?
Formatting is preserved. Comments and suggestion history are not — copied files start with a clean comment thread. Resolved comments in the original stay in the original.
Can I schedule automatic folder copies?
Absolutely. Combine folder copying with CodeWords scheduling to create weekly or monthly backups of critical Drive folders. Cody sets up the trigger and the copy logic together.
From workaround to workflow
The inability to copy a Google Drive folder natively is a minor inconvenience for individuals and a real bottleneck for teams. Every time someone manually duplicates a project template, they introduce risk: missed files, wrong permissions, forgotten subfolders. Automating the blueprint reproduction eliminates those errors and reclaims the time spent on mechanical file management.
As your team standardizes more processes into Drive-based templates, the payoff from automated copying compounds with each new project.
Automate your Google Drive folder workflows on CodeWords — describe the source, the destination, and the permissions. Cody builds the rest.




