title: Rename file names in google drive
body: <p>I have files in google drive in upper case, I want to rename them all to lower case</p>
  
  <p>Example :</p>
  
  <pre><code>ZVXDA0002-ZPOILTY024(full).xml should be renamed as zvxda002-zpoilty024(full).xml
  </code></pre>
  
  <p>here is the script I tried</p>
  
  <pre><code>function FileRenaming() {
    var SourceFolder = DriveApp.getFolderById("Test_rename")
    var Files = SourceFolder.getFiles();
    while(Files.hasNext()) {
      var file = Files.next();
      var FileRename =  file.makeCopy(file.getName());
      var DestinationFolder = DriveApp.getFolderById("Test_renameD")
      DestinationFolder.addFile(FileRename);
      SourceFolder.removeFile(file);
  }
  }
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>Exception: Unexpected error while getting the method or property getFolderById on object DriveApp. (line 2, file "Code")Dismiss
  </code></pre>