google drive

Google Drive File Locked

Resolution Checklist

  • 1 Understand file lock mechanisms in Google Drive
  • 2 Identify and close locking processes on Windows
  • 3 Identify and close locking processes on macOS
  • 4 Resolve cloud-side locks and real-time presence issues
  • 5 Summary Checklist for Google Drive Locked Files

Google Drive File Locked

When working with Google Drive, you may encounter errors such as “The action can’t be completed because the file is open in another program”, “File is locked for editing”, or “Access Denied” when trying to rename, move, or delete files.

These errors occur when the operating system or the Google Drive client (DriveFS) refuses to release its file handle. This guide shows how to locate the locking process and force-release the file.


1. Understand File Lock Mechanisms in Google Drive

File locks in Google Drive typically fall into three categories:

  1. Local OS Lock: An application (like Microsoft Office, Adobe Acrobat, or text editors) has opened the file and locked it to prevent concurrent modifications.
  2. Drive Sync Lock: The Google Drive client is actively syncing the file to the cloud. Until the upload is completed, Google Drive locks the file to prevent partial write conflicts.
  3. Real-Time Presence Lock: When multiple users edit Office documents inside a Shared Drive, Google’s “Real-time presence” engine locks the file for other desktop users to avoid conflicting edits.

2. Identify and Close Locking Processes on Windows

On Windows, applications often lock files aggressively. Use these methods to unlock them.

Step 1: Force Close Common Office Applications

If the locked file is a document, spreadsheet, or PDF, close the program that uses it. If the process is hung in the background:

  1. Open Command Prompt (Admin).
  2. Force quit Microsoft Office and Adobe Acrobat by running:
    taskkill /f /im excel.exe
    taskkill /f /im winword.exe
    taskkill /f /im powerpnt.exe
    taskkill /f /im acrobat.exe

Step 2: Use PowerShell to Find the Locking Process

If you don’t know which app is locking the file, run this PowerShell script to find it:

  1. Open PowerShell (Admin).
  2. Run the command to list processes holding handles inside your Google Drive virtual drive (assuming drive letter G:):
    Get-Process | Where-Object { $_.MainWindowTitle } | Format-Table Id, Name, MainWindowTitle
  3. Alternatively, search the system handles for the Google Drive directory:
    Get-Process | Where-Object {$_.Modules.ModuleName -like "*GoogleDrive*"}

Step 3: Restart Google Drive to Release Sync Handles

If Google Drive’s own service is locking the file:

  1. Terminate Google Drive:
    taskkill /f /im googlepackagedexe.exe
  2. Restart Google Drive from the Start menu. This releases all virtual filesystem hooks.

3. Identify and Close Locking Processes on macOS

On macOS, you can use the terminal command lsof (List Open Files) to pinpoint exactly which application is locking a file in the Google Drive FileProvider directory.

Step 1: Scan for Locked Files

  1. Open Terminal.
  2. Run the lsof command, pointing to your Google Drive CloudStorage path to see which processes are holding locks:
    lsof +D ~/Library/CloudStorage/
  3. To look for a specific file (e.g. Budget.xlsx), run:
    lsof | grep -i "Budget.xlsx"

Step 2: Kill the Locking Process

  1. Locate the PID (Process ID) from the second column of the lsof output.
  2. Force kill the application using the PID:
    kill -9 <PID>
    (Replace <PID> with the actual process number, such as kill -9 2045).

Step 3: Force Quit Google Drive

If Google Drive itself is locking the file due to an interrupted sync:

  1. Stop the client:
    killall "Google Drive"
  2. Launch Google Drive from applications to refresh the mounts.

4. Resolve Cloud-Side Locks and Real-Time Presence Issues

If the file is locked in a Shared Drive by another collaborator:

  • Request Ownership/Check-in: If the file is locked via Microsoft Office real-time presence, ask the other user to close the file on their desktop to release the lease.
  • Create a Copy: If you must edit the file immediately and cannot reach the owner, right-click the file on the Google Drive web portal, select Make a copy, make your edits in the copy, and replace the original when the lock expires.
  • Disable Office Real-Time Presence: If your team experiences frequent lock conflicts, you can disable the feature:
    1. Click the Google Drive icon in your system tray/menu bar.
    2. Go to SettingsPreferencesSettings (Gear icon).
    3. Scroll down to Microsoft Office and uncheck See if someone else is editing a shared Microsoft Office file.

5. Summary Checklist for Google Drive Locked Files

ScenarioRecovery Tool / CommandObjective
Microsoft Office Locktaskkill /f /im excel.exe / winword.exeKills background applications holding file locks.
Locate Lock on Maclsof +D ~/Library/CloudStorage/Lists all active file system locks in Google Drive.
Free Locked File (Mac)kill -9 <PID>Terminates the app holding the target file handle.
Sync Stalled LockRestart Google Drive ClientReleases virtual device drive hooks.
Shared Drive ConflictDisable Office Real-time PresencePrevents collaborative lock conflicts in desktop environments.