Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am going to assume you are familiar with Google Apps Script to the point where you know how to create a script in your drive, manage the editor etc ... if you are not please start here <a href="https://developers.google.com/apps-script/overview" rel="noreferrer">https://developers.google.com/apps-script/overview</a>.</p> <p>Here a little script that will list all your files and set them to the trash, you will still need to go to trash and delete forever.</p> <p>BE CAREFUL WHEN USING THIS SCRIPT : MOVES ALL FILES TO TRASH </p> <p>You will need to uncomment the file.setTrashed(true) when you run this</p> <pre><code>function processAllFiles() { // we look for the continuation token from the UserProperties // this is useful as the script may take more that 5 minutes // (exceed execution time) var continuationToken = UserProperties.getProperty('DELETE_ALL_FILES_CONTINUATION_TOKEN'); if (continuationToken == null) { // firt time execution, get all files from drive var files = DriveApp.getFiles(); // get the token and store it in a user property var continuationToken = files.getContinuationToken(); UserProperties.setProperty('DELETE_ALL_FILES_CONTINUATION_TOKEN', continuationToken); } else { // we continue to execute (and move everything to trash) var files = DriveApp.continueFileIterator(continuationToken); } while (files.hasNext()) { var file = files.next(); // file.setTrashed(true); Logger.log(file.getName()); } // finish processing delete the token UserProperties.deleteProperty('DELETE_ALL_FILES_CONTINUATION_TOKEN'); } </code></pre> <p>You might potentially be left with very many folders (if they were created programatically for some reason ;) ) so you could run this little script to move them to the trash aw well. Don't forget to uncomment the line that counts below.</p> <pre><code>function processAllFolder() { // Log the name of every folder in the user's Drive. var folders = DriveApp.getFolders(); while (folders.hasNext()) { var folder = folders.next(); Logger.log(folder.getName()); // folder.setTrashed(true); } }; </code></pre> <p>Let me know how that works out for you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload