Google Drive shortcut broken after automatic updates

The problem is keeping the shortcut pointing to the correct application executable on startup correctly since the folder path changes with each new version number. Each time this change occurs, it breaks user profile desktop icons for Google Drive.

The issue occurs after Google Drive does an automatic update and creates a new sub folder in the main folder of C:\Program Files\Google\Drive File Stream\<36.0.18.0> related to the correlated build\release number creating this problem.

Question: Could I turn off Google Drive automatic updates entirely to resolve, or are there other solutions that might work to resolve this dynamically for the shortcut?

enter image description here

Other detail & things I tried...

  • Now the GoogleDriveFS.exe application is located in 36.0.18.0 so the desktop shortcut no longer works as the path made on the install points to C:\Program Files\Google\Drive File Stream\35.0.13.0\GoogleDriveFS.exe which no longer exists (Directory Empty).
  • I am aware of the AutoStartOnLogin registry entry but this seems to be hit and miss for starting every time and even if it did the users desktop shortcuts would still not work.
  • All google drives were installed with the following parameters
    GoogleDriveFSSetup --silent --desktop_shortcut

You can use PowerShell as a startup script to identify the newest created GoogleDriveFS.exe file from within the \Drive File Stream and all beneath sub-folders recursively, and then use its full path to create (or replace) a shortcut .lnk file on the public desktop folder, or wherever is most appropriate for you.

Just use Task Scheduler or Group Policy to run the below logic as a Computer startup script. If using Task Scheduler, be sure to make the task run under the SYSTEM account for security.

PowerShell (version 3+)

$Src = "C:\Program Files\Google\Drive File Stream";
$Lnk = (Get-Childitem -Path $Src -Include "GoogleDriveFS.exe" -File -Recurse | % {"$($_.CreationTime), $($_.FullName)"}) | Sort-Object -Descending | Select -First 1 | %{$_.Split(",")[1].Trim()};
New-Item -ItemType SymbolicLink -Path "C:\Users\Public\Desktop" -Name "GoogleDrive.lnk" -Value $Lnk -Force;

PowerShell (version 2+)

$Src = "C:\Program Files\Google\Drive File Stream";
$Lnk = (Get-Childitem -Path $Src -Include "GoogleDriveFS.exe" -Recurse | % {"$($_.CreationTime), $($_.FullName)"}) | Sort-Object -Descending | Select -First 1 | %{$_.Split(",")[1].Trim()};
New-Item -ItemType SymbolicLink -Path "C:\Users\Public\Desktop" -Name "GoogleDrive.lnk" -Value $Lnk -Force;

Supporting Resources

  • Get-ChildItem
  • ForEach-Object

    Standard Aliases for Foreach-Object: the '%' symbol, ForEach

  • Sort-Object
  • Split()
  • Trim()
  • New-Item

Here is an easier solution for people that do not know about PowerShell or Group Policy.

  1. Go to the 'Properties' of the shortcut

  2. Replace the version number (eg. 34.0.20.0) with the new version number and save.

    Full file location string:

     C:\Program Files\Google\Drive File Stream\34.0.20.0\GoogleDriveFS.exe
    
  3. To change the shortcut icon, go to 'Change icon' and navigate to the Google Drive Stream folder and select GoogleDriveFS.exe and it will automatically select the correct icon.

If you change the shortcut properties, you don't need to reinstall