简体   繁体   English

静音initdb.exe PostgreSQL

[英]Silent initdb.exe postgresql

I am trying to install postgresql on a server using a bat file. 我正在尝试使用bat文件在服务器上安装postgresql。 I am using initdb.exe with --pwfile option so that it picks up the password form a text file and continues... 我使用带有--pwfile选项的initdb.exe,以便它从文本文件中提取密码并继续...

for some reason, even with --pwfile option, it is still prompting me for a password.. Not sure what the problem is.. This is the script I am using: 由于某些原因,即使使用--pwfile选项,它仍会提示我输入密码。.不确定问题出在哪里..这是我正在使用的脚本:

set DBPATH = something 
set DBADMIN = something 

set DBDATA = something

RunAs /noprofile /user:%computername%\postgres ""%DBPATH%\initdb.exe" --locale=C --encoding=UTF-8 -U %DBADMIN% --pwfile="D:\Pass.txt" -D "%DBDATA%"" 

Thanks 谢谢

If you want to install a software which requires for the installation administrator privileges and the current user account does not have the required privileges, it is possible to use command RunAs to run the installation executable and all processes started by this application with a different user account than the current user account which has the required privileges. 如果要安装需要安装管理员权限的软件,而当前用户帐户不具有所需的权限,则可以使用命令RunAs来运行安装可执行文件,并使用不同的用户帐户来运行此应用程序启动的所有进程拥有所需权限的当前用户帐户。

But the user has to enter nevertheless a password - the password for the other user account with the extended privileges to install applications. 但是用户仍然必须输入密码-具有扩展特权的另一个用户帐户的密码才能安装应用程序。 If it would be possible to run something requiring extended privileges for installing software without requesting entering the password by the user, every bad guy out in the world could very easily install trojaners and other malware (as it is possible on Windows 2000 / XP or since Windows Vista with user account control disabled). 如果可以运行需要扩展特权才能安装软件的东西而无需用户输入密码,则世界上每个坏蛋都可以很容易地安装木马和其他恶意软件(因为在Windows 2000 / XP或更高版本中可能Windows Vista(禁用了用户帐户控制)。

There are systems to deploy and install software on all clients of a company like Group Policy or System Center Configuration Manager . 有些系统可以在公司的所有客户端(例如组策略System Center Configuration Manager)上部署和安装软件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM