Quicken discourages users from storing their data file on Google Drive. They prefer to run it locally then back it up to Google Drive (which in our case is mirrored in both locations) when you exit. OK, we can do that. Add to the mix that we have PC1 at office and PC2 at home. User wants to, and should be able to, run Quicken at either location (only one at a time) and use Google Drive's replication to not have to manually update the files each time he switches locations.
So the script below aims to automate this process. His name was changed in it. Script checks 2 files in diff folders to see which is newer. It copies the Google Drive file if that one is newer; otherwise it starts Quicken using the local file. Once the user exits from Quicken, it copies the local data file to My Drive, and shows the user the timestamp of the data file. From there Google Drive replicates to the My Drive cloud, and is synced with the PC at the other location. Easy Peasy, right?
My problem is that the script errors out on the first FileCopy line with a 1009 WinBatch error reading the source file. But if I change the script and copy that same file from a different, non-MyDrive folder, it works. And if I manually copy that file it works. It's almost like there's something preventing the WinBatch FileCopy command from working with My Drive.
================ WINBATCH SCRIPT BEGIN
; File comparison between production Quicken data file location and backup location.
; If local file is not the most current it copies from My Drive to ensure we always open
; the most current file in the local folder no matter which computer (home or office) we run it from.
File1=FileTimeCode("C:\users\mike\documents\quicken\mike's quicken data.qdf")
File2=FileTimeCode("C:\users\mike\my drive\mike parker\quicken backups\Mike's Quicken Data.qdf")
If File1==File2
Stamp="File comparison shows that the Quicken files have the same timestamp. Will start Quicken with the local file."
GoTo Run
Else
If File1 > File2
Stamp="File comparison shows that the local file is newer. Will start Quicken with that file."
GoTo Run
Else
Stamp="File comparison shows that the MyDrive file is newer. Will copy it to the local Quicken folder, then start Quicken with that file."
FileCopy(File2, File1, @False)
EndIf
EndIf
:Run
;Message("", stamp)
DirChange("C:\Program Files (x86)\Quicken\")
RunWait("qw.exe","")
DirChange("C:\users\mike\documents\quicken\")
MyDrive=("C:\users\mike\my drive\mike parker\quicken backups\")
FileCopy("mike's quicken data.qdf", MyDrive, @False)
File3=FileTimeGet("C:\users\mike\my drive\mike parker\quicken backups\Mike's Quicken Data.qdf")
Message("The timestamp of the backup Quicken file on MyDrive is", File3)
================ WINBATCH SCRIPT END
Any ideas?