By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

(the new) google drive

Hello --- google's (consumer) cloud space, formerly known as "backup and sync" has been update and is now call just "google drive" the new google code changes the model that dropbox used (the default behavior) of mirroring the local file tree with the files in the cloud now with a "virtual drive" and caches files as they are used.

the folks over at google wrote a (clever?) bat file. launch.bat. that locates the "current version" of the code and then execute's that *.exe file

as it turns out, the bat file works fine when executed with cmd.exe, but fails with tcc.exe --- is there any way to debug this

any suggestions appreciated
it seems that I am having an issue attaching a file --- I will put a link to it in the cloud
This is the script file:
@echo off

rem Launcher script for GoogleDriveFS.exe that looks up the latest
rem GoogleDriveFS.exe and runs it with the same arguments as the script.
rem Convenient to use as a target for Windows shortcuts.

rem Use '!' instead of '%' for variable names.
setlocal EnableDelayedExpansion

rem First try looking in the registry.
set COMMAND="reg.exe query HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{6BBAE539-2232-434A-A4E5-9A33560C6283}  /v InstallLocation"
rem Get the 3rd and following tokens of the 2nd line separated by space.
for /f "skip=1 tokens=3,* usebackq" %%A in (`!COMMAND!`) do (
  set EXE_PATH=%%A %%B %%C %%D %%E %%F %%G %%H %%I %%J %%K %%L %%M %%N
rem Sadly we get back the unused %%variables at the end of the string.
rem Strip /%.+/ from the end.
for /f "tokens=1 usebackq delims=%%" %%A in ('!EXE_PATH!') do (
  set EXE_PATH=%%A

if exist "!EXE_PATH!" (goto :RUN_IT)

rem If we fail, look in the current directory.
set DRIVE_FS_DIR=%~dp0

rem Sort DRIVE_FS_DIR's subdirectories (/a:d) by reverse date (/o:-d) of
rem creation (/t:c) and find the first one that contains the exe.
for /f "usebackq" %%A in  (`dir "%%DRIVE_FS_DIR%%\*" /a:d /o:-d /t:c /b`) do (
  set EXE_PATH=!DRIVE_FS_DIR!\%%A\GoogleDriveFS.exe
  if exist "!EXE_PATH!" (goto :RUN_IT)

@echo Fatal error: Can't find DriveFS path. Please reinstall Drive for Desktop.
exit /b 1

@echo Found path: !EXE_PATH!
start "Launch Google Drive" "!EXE_PATH!" %*
exit /b 0

I have never seen delayed variable expansion used outside of a FOR statement.
Nothing stands out to me as to why it's not working for you. DelayedExpansion works for me in TCC. Perhaps you need to enable it in your TCC configuration by checking the "CMD.EXE delayed expansion (!var!)" option in the TCC OPTION dialog.
That's a pretty amazing batch file ... 46 lines of hardly human-readable (this human anyway) stuff just to do this.

v:\> echo The EXE is %@word[4-,%@execstr[regdir /v /d HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6BBAE539-2232-434A-A4E5-9A33560C6283} | findstr /i /r "installlocation.*googledrivefs.exe"]]

The EXE is C:\Program Files\Google\Drive File Stream\\GoogleDriveFS.exe

Thanks, Rex!
And note, uninstalling GoogleDrive does not uninstall, or even reconfigure these.

I believe those are used for pretty much any Google program that's installed. In my case it's Chrome. I've never had Drive installed.
Yeah, I figured that. I'd hate to see a batch file to determine what Google programs are installed.
I figured the update service would reference a list somewhere, so I went looking and found HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\Update\Clients. Mine has 5 entries; the 4 Google programs I have installed, plus the updater itself.

Similar threads