Try:
function RemoveEditors(){
var files = DriveApp.getFiles();
while (files.hasNext()) {
var file = files.next()
var docs = DriveApp.getFileById(file.getId());
var users = docs.getEditors();
for (i in users) {
email = users[i].getEmail();
if (email != "") {
docs.removeEditor(email);
}
}
}
}
Using getFiles() will allow you to get all of the files in the drive, then you can do the same process you had before.
EDIT
After reviewing the question I noticed you wanted to remove all perimssions, edit and view included, so I'm updating the code to go over all files & folders and remove both view and edit permissions, I'm leaving the old code as a reference. The new code:
function removePermissions(){
var files = DriveApp.getFiles();
var folders = DriveApp.getFolders();
while (files.hasNext()) {
var file = files.next()
var docs = DriveApp.getFileById(file.getId());
var editors = docs.getEditors();
var viewers = docs.getViewers();
var email;
for (i in editors) {
email = editors[i].getEmail();
if (email != "") {
docs.removeEditor(email);
}
}
for (i in viewers) {
email = viewers[i].getEmail();
if (email != "") {
docs.removeViewer(email);
}
}
}
while (folders.hasNext()) {
var folder = folders.next()
var docs = DriveApp.getFolderById(folder.getId());
var editors = docs.getEditors();
var viewers = docs.getViewers();
var email;
for (i in editors) {
email = editors[i].getEmail();
if (email != "") {
docs.removeEditor(email);
}
}
for (i in viewers) {
email = viewers[i].getEmail();
if (email != "") {
docs.removeViewer(email);
}
}
}
}