After reading a post from Pinal I am proposing another solution here to automate SQL backup infrastructure. The dditional advantage here in this approach is , the SQL objects are always created in a seperate file so this can be really helpful to compare your chages in DB from your last version.
2. Create a small batch file to call this script. Its handy to call it via batch file I guess. Ofcourseyou can use it directly.
3. Pass the required parameter to the batch file
cscript 0g_sqlextract.vbs %SERVER% %DB% %OUTPUT_FOLDER% %LOGIN% %PASSWORD%
4. Execute your batch file .
Have a great day