This is a sample of Google Apps Script. This script is for retrieving all files and folders under a folder on Google Drive. All files and folders in the specific folder can be retrieved.
If you want to retrieve file list with all files and folders on Google Drive, please use DriveApp.getRootFolder().getId()
as folderId
.
When there are a lot of files in the folder, it may be over the limitation time to execute script.