title: postgres, psql and a bat file
body: <p>I'm going around in circles and so need some help.</p>
  
  <p>I want to be able to run an .sql against a database which is a scheduled task via a bat file. However when i run the bat file manually I get prompted for a password. I enter the password and then get told that....</p>
  
  <pre><code>"psql: FATAL: password authentication failed for user "(my windows login)"
  '-h' is not recognised as an internal or external command, 
  operable program or batch file. 
  </code></pre>
  
  <p>At the moment my bat reads...</p>
  
  <pre><code>@echo off
  "D:\Program Files (x86)\PostgreSQL\9.1\bin\psql.exe"
  -h localhost -U postgres -d database_name -f D:/scripts/SQL/test.sql
  pause
  </code></pre>
  
  <p>First thing, what cmd do i need to add to populate the password request</p>
  
  <p>What am I doing wrong with the rest of the statement to get it to load the .sql</p>
  
  <p>Thanks</p>