I know that there is a lot of solved questions regarding executing processes from java.But I am unable to solve my problem using answers provided. I am trying go create post
Since pg_dump.exe
is an exe (not a .bat) you don't need the cmd
at all, and it is probably causing more problems than it solves. Just call the exe
directly, and remove the extra set of quotes around the file paths:
new String[]{"D:\\PostgreSQL 8.2\\bin\\pg_dump.exe","-U","usr","-i",
"-h","localhost","-p","5432","-F","c","-b",
"-f","D:\\backup test\\backups\\test_27-1-2013_210.backup", "test"}