Skip to content

Instantly share code, notes, and snippets.

@webgevel
Created January 25, 2018 09:32
Show Gist options
  • Save webgevel/81e39331d2d26c4b02b6efc99f04914c to your computer and use it in GitHub Desktop.
Save webgevel/81e39331d2d26c4b02b6efc99f04914c to your computer and use it in GitHub Desktop.
@ECHO OFF
ECHO ---------------------------------------------------
ECHO Google Drive FS - Change Mountpoint Utility v0.0001
ECHO ---------------------------------------------------
REM Scripted: Marc Vandael - 25/01/2018
REM Prompts for var _mountpoint.
REM If the letter is in use, the next free one will be used.
REM This attempts to write to HKLM & HKCU so admin rights are needed for this to work.
REM If you run this without admin rights, only the local user is affected.
SET /P _mountpoint= Choose a new mountpoint/driveletter:
reg add "HKLM\SOFTWARE\Google\DriveFS" /v DefaultMountPoint /t REG_SZ /d %_mountpoint% /f
reg add "HKCU\Software\Google\DriveFS" /v DefaultMountPoint /t REG_SZ /d %_mountpoint% /f
taskkill /f /im GoogleDriveFS.exe
FOR /F "tokens=* USEBACKQ" %%F IN (`where /R "C:\Program Files\Google\Drive File Stream" GoogleDriveFS.exe`) DO (
SET var=%%F
)
start "" "%var%"
msg * "That should be it. Manually Restart Google Drive FS if the driveletter hasn't changed automatically!"
msg * "Cheers"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment