(the new) google drive

Oct 18, 2008
339
2
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
 
Oct 18, 2008
339
2
it seems that I am having an issue attaching a file --- I will put a link to it in the cloud
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
This is the script file:
Code:
@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
rem First try looking in the registry.
rem
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
rem If we fail, look in the current directory.
rem
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)
)

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

:RUN_IT
@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.
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
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.
 
May 20, 2008
11,414
99
Syracuse, NY, USA
That's a pretty amazing batch file ... 46 lines of hardly human-readable (this human anyway) stuff just to do this.

Code:
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\51.0.14.0\GoogleDriveFS.exe

Thanks, Rex!
 
May 20, 2008
11,414
99
Syracuse, NY, USA
And note, uninstalling GoogleDrive does not uninstall, or even reconfigure these.

1632365069025.png
 
May 20, 2008
11,414
99
Syracuse, NY, USA
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.
 
Jun 2, 2008
359
4
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
Thread starter Title Forum Replies Date
C Google intregration error Support 4
vefatica Forums, Facebook, Google, Twitter Support 7
C Google Sendmail ? Support 15
rconn News Google translation Support 4
Jay Sage Problem Launching Google Earth from TCMD Support 17
Jay Sage Documentation Function @DRIVE Missing in Help Lists Support 0
DrusTheAxe Runaway TCC.exception.log filling drive Support 5
Jay Sage Removable Drive Not Detected Properly Support 11
gworley Virtual network drive filename completion doesn’t get directories Support 0
Chen Touboul TCC not recognize maped drive Support 18
C How to make list of drive contents when shutdown PC / Everything.exe Support 7
S 32-bit Take Command v22 install for thumb drive Support 1
vefatica DEL /R on a SUBST'd drive? Support 1
J Remote storage drive implementation Support 2
Fross WebDav Drive Mapping Issue Support 19
Joe Caverly How to? Use SYNC with a network drive Support 4
S How to? Registered Take Command 18 on USB thumb drive Support 1
I Hidden files on USB Drive Support 4
S WAD Cannot access mapped drive in 64b Win7 Support 15
T How to? @files and trapping "no disk in drive errors" Support 4
L Network Drive slowness Support 0
old coot dir /s dies on my C: drive Support 2
A How to? Get Drive Letter From Label Support 3
A How to? Wake up a sleeping drive Support 14
L How to copy an old xp drive to a large ntfs drive Support 6
E WAD Open handle on USB drive in TCC Support 3
Fross Accessing No-Drive Letter Resources Support 4
mfarah How can I tell if a drive is a SUBSTitute? Support 4
S Windows Title of Drive & Directory? Support 4
S Create links or junctions on network drive Support 5
S MOVE to different drive Support 3
S Lost Reg After Moving OS to Diff Drive Support 1
S Version 11 ZIP /V - Permission denied on Network drive Support 2
A GPF when copying large amount of data on busy USB Drive Support 3
R Take Command will not release network drive Support 2
R script problem with mapped network drive Support 1

Similar threads