读书人

批处理上怎么自动输入密码

发布时间: 2012-12-28 10:29:05 作者: rapoo

批处理下如何自动输入密码?
windows XP下安装了postgresql数据库后,想做个双硬盘的备份,但是调用以下批处理的命令时,会要求输入用户postgres的密码,如何在批处理文件中自动实现输入密码?
pg_dump -h localhost -p 5432 -U postgres db_storelib > "d:\storelib_20111105.backup"
[解决办法]
试试下面的格式行不行

echo 密码
[解决办法]
pg_dump -h localhost -p 5432 -U postgres db_storelib > "d:\storelib_20111105.backup"
[解决办法]
-w
--no-password
Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.

读书人网 >windows

热点推荐