There is removeFile
method in DriveApp API
for Google App Script, but here it states that this method does not delete file permanently. All the files removed using this method can be found using search bar in Google Drive. Is there a way to delete file permanently from Google Drive using Google APP Script?
Asked
Active
Viewed 2,200 times
0

charles bell
- 67
- 7
-
You need to do research before blindly asking questions – tehhowch May 11 '18 at 11:40
-
I am very sorry, I had seen this answer before but got confused in `Drive.files` and `DriveApp.files` – charles bell May 11 '18 at 14:35
-
1yes, there is the chance to be confused by the native, simpler, and less capable Apps Script implementation of `Drive`, which is accessed by `DriveApp`, and the powerful, "advanced service" `Drive`, which is an Apps Script client library that implements v2 of the Drive REST API. – tehhowch May 11 '18 at 14:46
1 Answers
1
You can use
DriveApp.getFileById(fileId).setTrashed(true);

Darpan Sanghavi
- 1,443
- 2
- 17
- 32
-
-
Yes, if you want to Delete it from Trash then you can use `Drive.Files.emptyTrash();` – Darpan Sanghavi May 11 '18 at 11:42
-
@DarpanSanghavi and also delete every other trashed file, which may not be desired. – tehhowch May 11 '18 at 14:42