Wednesday, July 28, 2010

Uploading Lots of ICS Files to Google Calendar

I found a great tool for this at: http://gcalicsimporter.codeplex.com/releases/view/34662#ReviewsAnchor

To make it easier to use I created a batch file, which you can also try out. Leave a comment if you liked it!

In the directory you extracted the zip file, create a new file called "upload-to-google-calendar.bat"

Edit the file and paste in the following code, then save the file and double click it:


:: Thanks to amezcua the developer from: http://gcalicsimporter.codeplex.com/releases/view/34662#ReviewsAnchor
:: Batch file written by Roger Symonds of CustomWare http://www.customware.net


@echo off
:start
cls

echo Press 1 - To find ICS files in this directory
echo Press 2 - To find AND upload ICS files in this directory:
echo Press 3 - For help
echo.
echo.


set /p userinp="Type a number and hit Enter: "
set userinp=%userinp:~0,1%
if "%userinp%"=="1" goto 1
if "%userinp%"=="2" goto 2
if "%userinp%"=="3" goto 3
echo invalid choice

goto start


:1
:: Get the name of each .ics file in the current folder and save it in a file
FOR /f "tokens=*" %%J in ("dir /b *.ics") Do ( %%J > tempfile.txt)
:: Show the user the ics files that will be processed
echo The following files were found:
echo.
type tempfile.txt
echo.
echo.
echo When done hit Enter to close this window
goto end


:2
:: Get the name of each .ics file in the current folder and save it in a file
FOR /f "tokens=*" %%J in ("dir /b *.ics") Do ( %%J > tempfile.txt)
:: Show the user the ics files that will be processed
type tempfile.txt
:: upload each of the .ics files to the Google calendar configured in gcalicsimporter.config
FOR /f %%H IN (tempfile.txt) DO gcalicsimporter.exe %%H
echo When done hit Enter to close this window
goto end


:3
echo Make sure to set your Google Calendar settings in the file "gcalicsimporter.exe.config"
echo.
echo If there's a problem with the upload it will add a blank event in your calendar starting at the time you ran the upload
echo.
echo Google Calendar will not allow you to upload the same event twice
echo.
echo There is also a limit of 5000 ICS uploads per day with Google Calendar
echo.
echo.
echo When done hit Enter to close this window

goto end
etc.
:end
pause>nul

No comments: