title: Why am I getting pg_dump: too many command-line arguments error on my backup batch file?
body: <p>I am using this batch file to backup my database:</p>
  
  <pre><code>    @echo off
     for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
       set dow=%%i
       set month=%%j
       set day=%%k
       set year=%%l
     )
     for /f "tokens=1-2 delims=/:" %%a in ('time /t') do (
       set time=%%a%%b
     )
     set datestr=%month%_%day%_%year%_%time%
     echo datestr is %datestr%
  
     set BACKUP_FILE=C:\database_files\db_backup\DailyBackup_%datestr%.backup
     echo backup file name is %BACKUP_FILE%
     SET PGPASSFILE=C:\Users\Administrator\AppData\Roaming\postgresql\pgpass.conf
     echo on
     "C:\Program Files\PostgreSQL\9.0\bin\pg_dump" -i -h localhost -p 5432 -U postgres -F c -b -v -f %BACKUP_FILE% databasename
  </code></pre>
  
  <p>When I run it I get the error mentioned in the title. If i remove the part where I set the name of the file to include the time, it works.</p>