Google Drive – Delete Shared Document Owned by Someone Else

google-drive

If I delete a document owned by me, everybody loses access to that document. However, if I delete a document owned by someone else, it is only deleted from my point of view. Everybody else still sees that document.

In an environment where everybody is responsible for maintaining a pool of documents, this is terribly confusing. How do I delete a document on behalf of another user so that the document is gone for everybody?

Edit For Google Apps accounts, this was resolved nicely in late 2018 with the introduction of the Team Drive feature. We've had good experience with the co-ownership use case I described above after moving documents into one.

Jury is still out on a good solution for personal accounts.

Best Answer

To work around the problem, you can use a naming convention and a script. E.g., the users can agree to consider a file deleted if its name is "zzz_delete_this_file" (multiple files can have the same name in Google Drive).

Users can also install the following script (general information on scripts) and have it run every hour or every minute:

function myFunction() {
  var files = DriveApp.getFilesByName("zzz_delete_this_file");
  while (files.hasNext()) {
   var file = files.next();
   file.setTrashed(true);
  }
}

This moves all files with such a name into trash; in 30 days they get deleted.