I modified it a little to use the 64 bit calibre and 64 bit curl and to install using the MSI file. You need to change the paths for your computer.
It seemed to work for me.
I made a few more changes. Mine works now...

It doesn't delete the download but moves it to another directory.