5

Assume someone shares a folder with me, he remains the owner of the folder. Then I put some (many) files into this folder, of which I am and remain the owner. Then that someone revokes my access to said folder.

Now, where can I access these files in a useful way? I know that I can still access the file from the "Quota" list, but only the large ones can be accessed in a useful way, the smaller ones are somewhere much further down and mixed into all other files.

1
  • 1
    Oh funny, once I typed this questions, googling for drive orphans gives some answers that I hadn't found before: support.google.com/a/answer/6008339 However, it does not answer my question, because none of these options gives me only the orphans.
    – bers
    Mar 9, 2015 at 18:41

2 Answers 2

6

https://support.google.com/a/answer/6008339?hl=en states that a search in Drive for is:unorganized owner:me returns orphaned items that you own. Note that it returns the top-level folder if a folder hierarchy has been orphaned.

From there you can use Move... to add item en masse to your own Drive.

4

EDIT: Some parts of this answer are now obsolete as Find your files - Drive Help was updated recently. This was noted thanks to the answer by Dean Ransevycz


At this time Google Drive doesn't include a view nor a search operator to find only orphaned files. From [1]:

To find an orphaned item, do one of the following:

  • Search for the item in the search box at the top of Google Drive on the web.
  • If you own the orphaned item, you can get a list of everything you own and look for the item in that list. Click the down arrow in the Google Drive search box and select Ownership > Owned by me.
  • If you've accessed the file recently, click Recent in the left navigation and then browse for the file.
  • To browse everything in Google Drive on the web, click More in the left navigation, and then click All Items (Classic Google Drive only).

Once you find the orphaned file, you'll probably want to move it into My Drive (or another folder), to give it a home and make it easier to find in the future.

From [2]

... you can extend the capabilities of documents, spreadsheets, and forms by adding custom menus, dialogs, and sidebars with Google Apps Script

Assume that you want to automatically move the Orphaned files to a folder in "My Drive" named Orphaned

From: https://stackoverflow.com/a/27957068/1595451

 function collectOrphans(findOrphaned) {
   var folder = DriveApp.getFoldersByName('Orphaned').next();
   var files = DriveApp.getFiles();
   var orphanCount = 0;
   while(files.hasNext()){
      var file = files.next();
      if(!file.getParents().hasNext()){
        folder.addFile(file);
        orphanCount++;      
      }
    }
   Logger.log('Moved ' + orphanCount + ' orphans successfully.');
}

Remarks

  • The above code could exceed the processing time limit, so could be necessary to call it several times. The Continuous Batch Library ([3]) could be useful for dealing with this.
  • Folders also could be orphans, the above code only works for files but could be used as a base for collecting orphan folders.

References
1 Find your files - Drive Help
2 Extend Google Docs, Sheets, and Forms with Apps Script - Docs editors Help
3 Continous Batch Libray UPDATE for Google Apps Script

2
  • Thanks, but I think this quote appears exactly on the page I am referring to in my comment to my question.
    – bers
    Jun 29, 2015 at 1:50
  • @bers: Comments are not the best place for the author of question to add relevant information about his own question. Instead edit the question. To learn more a bout comments, please read webapps.stackexchange.com/help/privileges/comment.
    – Rubén
    Jun 29, 2015 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.