I assume that you are familiar with Google Apps Script to a level where you know how to create Script on your drive, manage the editor, etc ... unless you start here https://developers.google.com/ apps-script / overview .
Here is a little Script in which all your files will be listed and install them in the trash, you still need to be permanently deleted and deleted.
BE CAREFUL WHEN USING THIS Script: MOVES ALL FILES TO SKIP
You need to uncomment the .setTrashed (true) file when running this
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'); }
Perhaps you can have so many folders (if they were created programmatically for some reason;)) so you can run this little Script to move them to the trash well. Do not forget to uncomment the line that is counted below.
function processAllFolder() { // Log the name of every folder in the user Drive. var folders = DriveApp.getFolders(); while (folders.hasNext()) { var folder = folders.next(); Logger.log(folder.getName()); // folder.setTrashed(true); } };
Let me know how it works for you.
patt0
source share