So, I tried to write a batch file that would sync my local Google Drive folder with my flash drive when I ran it. Since robocopy is a one-way process, I am setting up my code, so it asks you if you want to sync with Google Drive or with Google Drive. This is so that no matter in which of the two places I create something or edit something, I can always synchronize the latest version with both locations.
Before anything happens, the code also checks that it is connected to my computer, and not to anyone else, by checking its name.
Here's what my code looks like right now:
@echo off
If "%computername%"=="JAKE-PC" (
color 02
set /P c=Sync TO or FROM Google Drive[T/F]?
:choice
if /I "%c%" EQU "T" goto :to
if /I "%c%" EQU "F" goto :from
goto :choice
:to
echo Syncing to Google Drive...
robocopy ".\Google Drive\ " "C:\Users\Jake\Google Drive\ " * /mir /xo
goto :done
:from
echo Syncing from Google Drive...
robocopy "C:\Users\Jake\Google Drive\ " ".\Google Drive\ " * /mir /xo
goto :done
:done
echo Sync Complete.
pause
)
If NOT "%computername%"=="JAKE-PC" (
color 04
echo Not Jake PC!
pause
)
, . -, T, Google . Google , F, Google .
, . "a.txt" - "b.txt" Google , , :
-sync Google , a.txt Google -, b.txt .
-sync FROM Google Drive, b.txt - Google , a.txt .
, , , . ? / . , robocopy.