you probably want to use the SQLcmd batch file program just create a sql script with the commands you want executing...
preferably within a stored procedure...
then for the user id's just use windows authentication and a (-E parm) Tristed Login so that you don't have to worry about coding userids/passwords...
sqlcmd -Sservername -ddatbaseName -E -iInputfile -oOutputfile