Batch convert local Google Drive shortcuts (.gdoc, .gsheet, .gslides) into real Office files (.docx, .xlsx, .pptx) directly within your folder structure.
- In-Place Export: Saves converted files next to the original shortcuts.
- Smart Naming: Adds suffixes (e.g.,
_from_gdocs) to prevent overwrites. - Recursive: Scans all subfolders automatically.
- Robust: Uses API search to bypass Windows "Invalid Function" errors on virtual drives.
You need a Client ID and Client Secret from the Google Cloud Console:
- Create a Project and enable the Google Drive API.
- Configure OAuth Consent Screen (User Type: External) and add your email as a Test User.
- Create Credentials (OAuth Client ID -> Application type: Desktop App).
Run the script in PowerShell:
powershell.exe -ExecutionPolicy Bypass -File "Export-GoogleShortcuts.ps1" `
-RootPath "G:\My Drive\Target Folder" `
-ClientId "YOUR_CLIENT_ID" `
-ClientSecret "YOUR_CLIENT_SECRET"
Files larger than 10MB cannot be exported via the API. If a file is too large (e.g., heavy presentations), the script will skip it and alert you to download it manually via the browser.
MIT License. Use at your own risk.