Skip to content

Get all files in Google drive shared link.


You have lots of files in the google drive, and you want to share all of them at once. Then get the file name and shared link in google sheets to use later with excel



  1. Upload all files to a folder in google drive
  2. Open the desired Google Drive folder and get its ID in the URL from the browser location bar:<id>
  3. Open a new Google Sheet and navigate
    1. Tools > Script ditor. In the new script, paste the following script:




function myFunction() {

  var ss=SpreadsheetApp.getActiveSpreadsheet();

  var s=ss.getActiveSheet();

  var c=s.getActiveCell();

  var fldr=DriveApp.getFolderById(“folderID”);

  var files=fldr.getFiles();

  var names=[],f,str1,str2;

  while (files.hasNext()) {;

    str1=’=text(“‘ + f.getUrl() + ‘”,”‘ + “” + ‘”)’;

    str2=’=text(“‘ + f.getName() + ‘”,”‘ + “” + ‘”)’;








  1. Replace folderID with step 2
  2. Run the script



It will list in the google sheet file link, and file name