Visual Studio Express is free
Microsoft Express Home - Visual Studio Express and SQL Server Express are free tools but I don't know if "Setup & Deployment" project templates are included in the free version. Also there are bound to be available free version of deployment tools on the web,
Find Open Source Alternatives to commercial software | Open Source Alternative - osalt.com might have some.
What I noticed first with the script (.bat) was it assumes that it can write to the current folder that isn't always the case. A fix for that is to use the %TEMP% or "TMP% variable.
Best of luck,
ZW.