ZTree.com  | ZEN  | About...  

 Index   Back

[Help!] Batch file to detect changing Google Drive startup program version number   [Help!]

By: Andrew Watson     Perth, Western Australia  
Date: Dec 17,2023 at 13:51

On my travel PC which has limited storage (128GB) I have a startup batch file that mounts an encrypted VeraCrypt A: drive on a 256GB USB drive D:.

The USB drive is a low profile SanDisk Ultra Fit USB 3.1 flash drive that doesn't stick out very far. I have Gaffer tape over the drive to prevent it being knocked out when inserting / removing it from backpack.


Because I am concerned that the PC may be lost / stolen I point Google Drive and OneDrive to A:.

It has worked very well for several years. However, there is one slightly annoying glitch:

The path to the startup file for Google Drive includes the version number which changes quite frequently.

C:\Program Files\Google\Drive File Stream\\GoogleDriveFS.exe" --startup_mode

It's not a big deal because when it changes, an error message is displayed which I know means I have to find out the latest version number and amend the batch file.

I was wondering if any of the batch file gurus here could devise some code that could automatically detect the latest version number and run that version?

If it's of any use, the Drive File Stream folder contains the files listed below and 3 folders:

"C:\Program Files\Google\Drive File Stream\deleteonreboot"
"C:\Program Files\Google\Drive File Stream\launch.bat"
"C:\Program Files\Google\Drive File Stream\docs.ico"
"C:\Program Files\Google\Drive File Stream\drive_fs.ico"
"C:\Program Files\Google\Drive File Stream\sheets.ico"
"C:\Program Files\Google\Drive File Stream\slides.ico"

* - Presumably the previous version which will be deleted on next boot. There is only one file in the folder drivefsext.dll which presumably was in use when the other files were deleted.

* - This contains:

"C:\Program Files\Google\Drive File Stream\\snapshot_blob.bin"
"C:\Program Files\Google\Drive File Stream\\v8_context_snapshot.bin"
"C:\Program Files\Google\Drive File Stream\\icudtl.dat"
"C:\Program Files\Google\Drive File Stream\\chrome_elf.dll"
"C:\Program Files\Google\Drive File Stream\\d3dcompiler_47.dll"
"C:\Program Files\Google\Drive File Stream\\dokancc31357.dll"
"C:\Program Files\Google\Drive File Stream\\drivefsext.dll"
"C:\Program Files\Google\Drive File Stream\\libcef.dll"
"C:\Program Files\Google\Drive File Stream\\libEGL.dll"
"C:\Program Files\Google\Drive File Stream\\libGLESv2.dll"
"C:\Program Files\Google\Drive File Stream\\vk_swiftshader.dll"
"C:\Program Files\Google\Drive File Stream\\vulkan-1.dll"
"C:\Program Files\Google\Drive File Stream\\crashpad_handler.exe"
"C:\Program Files\Google\Drive File Stream\\GoogleDriveFS.exe"
"C:\Program Files\Google\Drive File Stream\\switchblade_host.exe"
"C:\Program Files\Google\Drive File Stream\\uninstall.exe"
"C:\Program Files\Google\Drive File Stream\\vk_swiftshader_icd.json"
"C:\Program Files\Google\Drive File Stream\\chrome_100_percent.pak"
"C:\Program Files\Google\Drive File Stream\\chrome_200_percent.pak"
"C:\Program Files\Google\Drive File Stream\\resources.pak"

* Drivers



:: Startup folder location
::C:\Users\Andrew\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Start-up

SET VERACRYPTPROG="C:\Program Files\VeraCrypt\VeraCrypt.exe"
SET ONEDRIVESTART="C:\Users\Andrew\AppData\Local\Microsoft\OneDrive\OneDrive.exe" /background
SET GOOGLEDRIVESTART="C:\Program Files\Google\Drive File Stream\\GoogleDriveFS.exe" --startup_mode
SET DROPBOXSTART="C:\Program Files (x86)\Dropbox\Client\Dropbox.exe"

type "%VERACRYPTDATA%\beep.txt"
timeout /T 1

type "%VERACRYPTDATA%\beep.txt"
timeout /T 1

type "%VERACRYPTDATA%\beep.txt"
timeout /T 1

start "" /wait %VERACRYPTPROG% /volume "%VERACRYPTDATA%\VeraCrypt.hc" /letter A /beep /quit
timeout /T 2

timeout /T 2

timeout /T 2

::start "" %DROPBOXSTART%


Andrew Watson


Messages in this Thread

96,626 Postings in 12,229 Threads, 350 registered users, 32 users online (0 registered, 32 guests)
Index | Admin contact |   Forum Time: Feb 21, 2024 - 11:11 am UTC  |  Hits:61,509,212  (3,563 Today )
RSS Feed