A C# console app that uploads Microsoft Office files to Google Drive, converts them into Google Docs/Sheets, and opens them in Chrome. If a file with the same name already exists, it skips the upload and opens the existing file instead. Built as a lightweight automation utility. Feel free to critique it.
This is a local-only demo (desktop tool).
- Windows
- Visual Studio (or MSBuild)
- .NET Framework 4.5.1+
- Google Chrome
Open the solution and run it.
Microsoft To Google Drive.slnPress Start (F5) to build and run.
Build from the command line (if MSBuild is installed):
msbuild "Microsoft To Google Drive.sln" /p:Configuration=ReleaseRun the exe from:
Microsoft To Google Drive/bin/Release/Microsoft To Google Drive.exe
- Create a Google Cloud project and enable the Google Drive API.
- Create OAuth 2.0 Desktop App credentials and download
credentials.json. - Place the file here (path is hardcoded in
Program.cs):
C:\MoveToGoogle\Properties\credentials.json
A token cache is created at:
C:\MoveToGoogle\Properties\token.json
The app deletes this token folder at the end of each run.
The app expects a file path as the first CLI argument, for example:
"C:\path\to\file.xlsx"
Typical usage is to set the app as the default handler for:
.xlsx.csv.doc.docx
When a user opens a file, it uploads/converts it and opens the Google Docs/Sheets link in Chrome.
- Excel:
.xlsx,.csv→ Google Sheets - Word:
.doc,.docx→ Google Docs
- Reads the file path passed in via args.
- Checks Google Drive for a matching name.
- If found, opens the existing doc in Chrome.
- If not, uploads, converts, and opens the new doc.
- Chrome is launched from
C:\Program Files\Google\Chrome\Application\chrome.exe(or x86 fallback). - The upload uses Drive API v3 with OAuth2.
- NuGet packages in
packages.configare older; upgrading is recommended.
Enjoy!