@echo off chcp 437 %~d0 cd %~p0 set psqlrc=psqlrc.conf :loop D:\AppsPortable\PostgreSQL\9.5.0\bin\psql -U postgres rem set path and connection string for your server ^^ goto loop