2

I'm using the Application Launcher For Drive extension on Chrome and it allows me to open files with certain programs on my local computer when right-clicking a file on the Google Drive website (https://drive.google.com).

It would also be useful to be able to open folders in Explorer (I have already installed Google Drive for Desktop for Windows 10 so the folder exists on my computer).

However, if I try to open the folder with a local program, it says that I need to connect more apps, but the only apps available if I click are from the Google Workspace MarketPlace:

enter image description here

Is there a way to configure Explorer.exe or Google Drive for Desktop, so that it can open folders in the appropriate path on my computer (eg. H:\Shared drives or H:\My Drive)?


Currently, this feature works great for files. For instance, if I right click on a PNG file in the Browser, I get the option to open the file with software I have on my computer:

enter image description here

I'm assuming that this has to do with the file extension similarly as when you right-click on the file in Explorer and select Open With.

enter image description here

I can influence this behavior by changing how file extensions are associated to programs on my computer, but I can't figure out how to do this for Google Drive folders since there is no extensions.


EDIT: As suggested by Wicket, I've tried the following as well :

  • To make a backup folder.

enter image description here Outcome: Still no option to open the folder locally.

  • To make the folder available offline

enter image description here Outcome: Didn't change anything relative to the Open With option.

This makes me think, this is more of a problem with the chrome extension than anything. It's like it doesn't know how to deal with a folder.

Note that I've emailed the developer of the extension about this and I'll post updates here if I get an answer.

3 Answers3

1

Apparently, you want to open a local folder from the Google Drive app for the Web (https://drive.google.com).

As far as I know that it's not possible for My Drive and Shared Drive folders.

Something that is commonly misunderstood about Google Drive service is that contrary to how file management is done "traditionally", it works very differently. In Google Drive, folders are actually a special type of document rather than what desktop operative systems like Windows call folders. Files have Media types but folders (see Directory (computing), Wikipedia article) in "traditional" files systems haven't Media types. Just think that to send a folder by email it should be compressed, sometimes this is referred to as "to zip" after ZIP (file format) (Wikipedia article).

Usually, desktop operative systems store files in a single storage unit, and use the concept Path (computing) (Wikipedia article). On the other hand, Google Drive stores files in multiple storage units and could also store files across multiple data centers. To explain this, Google has made multiple attempts over the years to explain this. One example is this Youtube video How does storage work across Google data centers? posted in the Google Cloud Tech channel. The video was posted on July 21, 2021.

Another misunderstanding is what is a software application and the other types of software needed to run a computer. In relation to what this question is specifically asking, explorer.exe is not a software application. To learn what explorer.exe is, please check out File explorer (Wikipedia article).

It's very likely that you will have to make use of a web browser extension that is capable to extract the file path of your folder, somehow communicating with the operative system of your device to build a full file path. Once the full file path was built, it should be passed to a process that tells your computer to open a folder. This is not a simple task as involves handling several security protection measures. Keeping up to date with something like this doesn't look to be something that nowadays Google might be interested to develop as they focus on stuff that will be used by millions of users. Very rarely do they invest, and keep running in the long term, a niche feature.

I wonder if this might be possible for local backups; I have not used this option. If you decide to explore this possibility by yourself, start by reading Use Google Drive for desktop (help article from Google Drive Help Center).

Below there are the specific instructions to upload "other folders" from your computer (copy-pasted as plain text).

Options for other folders on your computer

Configure other folders on your computer

  1. Open Drive for desktop.
  2. Click Settings and then Preferences.
  3. On the left, click Folders from your computer.
  4. From this menu, you can add folders to sync with Drive and backup to Photos and edit preferences of folders that are already synced.

If you go for creating your own tool, be aware that Google uses obscure front-end optimization tools and like to do A/B testing. One of the effects of this is that the DOM might change "suddenly". Spend time learning about screen scraping/web scraping and choose wisely the programming language/platform that you will use. Be very careful about AI tools like ChatGPT.

Related

Help articles

Help articles from Google Drive Help Center

  • View & open files
    This help article includes the instructions to open files hosted in Google Drive using a local application from the app for the Web.

Questions

Questions about Google Drive for Desktop for Windows and (Windows) File Explorer

Folders (directories)

Questions from Stack Overflow

Wicket
  • 715
  • 3
  • 16
1

Installing Google Drive for Desktop should have added Virtual Google Drive to Explorer under "Quick access" and have assigned it a drive letter. Typically this would be called "Google Drive (G:)". Double clicking this drive would open your Google drive folders inside Explorer.

See also Adding Google Drive for Desktop to the Windows Explorer sidebar.

Otherwise, for select sub-folders which are not easily accessed from Explorer, you could in the Google Drive web interface, right-click on the folder, then click "Add shortcut to Drive", click "Add shortcut" again in the dialog to store it in your "My Drive" folder (or elsewhere if you wish). Now in Explorer you can navigate to "My Drive" and double-click the shortcut to enter the folder.

harrymc
  • 498,455
0

A workaround that I found to save time was to create a Google Workplace Add-On that displays the path of the folder, so I can just open Explorer and paste the folder path to navigate to the folder quickly.

It is mostly useful when navigating to folders that are deeply nested. I just open the pane of the Add-On and the link is generated when I click on a folder.

Add-On Pane

How to

For this I had to create a new Google Apps Script project with the 2 following files:

code.gs


const displayLogs = false;

async function onDriveHomePageOpen() { return makeWelcomCard(); }

function makeWelcomCard() { var userProperties = PropertiesService.getUserProperties(); var selectedLanguage = userProperties.getProperty('selectedLanguage') || 'en'; // Default to English if not set

var card = CardService.newCardBuilder(); var section = CardService.newCardSection();

var textParagraph = CardService.newTextParagraph().setText("Please select your language"); section.addWidget(textParagraph);

// Create a dropdown for selecting English or French var languageDropdown = CardService.newSelectionInput() .setType(CardService.SelectionInputType.DROPDOWN) .setTitle("Language") .setFieldName("language") .addItem("English", "en", selectedLanguage === 'en') .addItem("French", "fr", selectedLanguage === 'fr');

section.addWidget(languageDropdown);

// Add a button to save the selected language var saveButton = CardService.newTextButton() .setText("Save") .setOnClickAction(CardService.newAction().setFunctionName("handleLanguageSelection"));

section.addWidget(saveButton);

// Add the section to the card card.addSection(section);

return card.build(); }

function handleLanguageSelection(e) { var language = e.commonEventObject.formInputs.language.stringInputs.value[0];

// Store the selected language in the user's properties PropertiesService.getUserProperties().setProperty('selectedLanguage', language);

// Optionally, create a response card or message var responseCard = CardService.newCardBuilder() .addSection( CardService.newCardSection().addWidget( CardService.newTextParagraph().setText("Language selection saved: " + (language === 'en' ? 'English' : 'French')) ) ) .build();

return CardService.newActionResponseBuilder() .setNavigation(CardService.newNavigation().pushCard(responseCard)) .build(); }

async function onDriveItemsSelected(e) {

let logs = ""; let selectedLanguage = PropertiesService.getUserProperties().getProperty("selectedLanguage"); if (selectedLanguage == null || selectedLanguage == "") {

return makeWelcomCard();

} else { logs += "lang:" + selectedLanguage + "\n"; }

let itemDetails = e.drive.selectedItems[0]; let mimeType = itemDetails.mimeType;

let item = null; if (mimeType === "application/vnd.google-apps.folder") { item = DriveApp.getFolderById(itemDetails.id); } else { item = DriveApp.getFileById(itemDetails.id); }

var parents = []; let parentFolders = item.getParents(); //Change it to the correct drive (D:, E:, F:, G:, etc.) let localDriveLetter = "G"; let localPath ="";

while (parentFolders.hasNext()) { var folder = parentFolders.next(); logs += folder.getName() + "\n" let name = folder.getName(); if (name == "Drive") { if (Drive.Drives.get(folder.getId()).name != "Drive") { name = "Shared Drives\" + Drive.Drives.get(folder.getId()).name; } } parents.push(name); parentFolders = folder.getParents(); } parents = parents.reverse();

for (i = 0; i < parents.length; i++){ localPath = localPath + "\" + parents[i]; }

//Remove first backslash localPath = localPath.substring(1);

// Add the item name to the local file path localPath += "\" + item.getName();

// Split the localPath into rootFolder and remainingPath let firstBackslashIndex = localPath.indexOf("\"); let rootFolder = localPath.substring(0, firstBackslashIndex); let remainingPath = localPath.substring(firstBackslashIndex + 1);

// Replace root folder names based on the selected language if (selectedLanguage === 'fr') { logs += "Language detected: fr"+ "\n" rootFolder = rootFolder.replace("My Drive", "Mon Drive"); rootFolder = rootFolder.replace("Shared Drives", "Drive partagés"); logs += rootFolder + "\n"; } else { logs += "Language detected: en"+ "\n" }

// Reconstruct the localPath localPath = rootFolder + "\" + remainingPath;

// Add the drive letter localPath = localDriveLetter + ":\" + localPath;

// Add the current date and time to the logs var currentDateTime = new Date(); logs += "Current date and time: " + currentDateTime.toLocaleDateString() + " " + currentDateTime.toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit' }) + "\n";

return makeCard(localPath, logs); }

function makeCard(text, logs) { var card = CardService.newCardBuilder(); var section = CardService.newCardSection();

// Add text paragraph var textParagraph = CardService.newTextParagraph().setText(text); section.addWidget(textParagraph);

// Add the section to the card card.addSection(section);

if (displayLogs) { var logSection = CardService.newCardSection();

logSection.addWidget(CardService.newTextParagraph().setText(logs));

// Add the section to the card
card.addSection(logSection);

}

return card.build(); }

appsscript.json

{
  "addOns": {
    "common": {
      "name": "Customize Drive UI",
      "logoUrl": "https://i.imgur.com/HtRBNvr.png"
    },
    "drive": {
      "homepageTrigger": {
        "runFunction": "onDriveHomePageOpen",
        "enabled": true
      },
      "onItemsSelectedTrigger": {
        "runFunction": "onDriveItemsSelected"
      }
    }
  },
  "timeZone": "America/Toronto",
  "dependencies": {
    "enabledAdvancedServices": [
      {
        "userSymbol": "Drive",
        "version": "v3",
        "serviceId": "drive"
      }
    ]
  },
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8"
}

Then I had to make a test deployment in order for it to appear when I'm using Google Drive.