首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >PostgreSQL安装错误:环境变量COMSPEC似乎没有指向cmd.exe

PostgreSQL安装错误:环境变量COMSPEC似乎没有指向cmd.exe
EN

Stack Overflow用户
提问于 2022-05-17 09:33:11
回答 5查看 5.4K关注 0票数 4

我是PostgreSQL的新手,当我试图在我的Windows 10设备上安装PostgreSQL 13 / 14时,我遇到了以下错误。

代码语言:javascript
运行
复制
"The environment variable COMSPEC does not seem to point to the cmd.exe or there is a training semicolon present. Please fix this variable and restart installation." 

弹出错误的屏幕截图

COMSPEC系统变量

这是我的COMSPEC 环境变量的设置

installbuilder_installer.log的内容

代码语言:javascript
运行
复制
Log started 05/06/2022 at 17:51:52
Preferred installation mode : qt
Trying to init installer in mode qt
Mode qt successfully initialized
Setting variable whoami from C:\WINDOWS\System32\whoami 
Script exit code: 0

Script output:
 atrapa\junkwong

Script stderr:
 

Executing C:\WINDOWS\System32\icacls "C:\Users\junkwong\AppData\Local\Temp/postgresql_installer_c7c2d91f40" /inheritance:r
Script exit code: 0

Script output:
 processed file: C:\Users\junkwong\AppData\Local\Temp/postgresql_installer_c7c2d91f40
Successfully processed 1 files; Failed processing 0 files

Script stderr:
 

Executing C:\WINDOWS\System32\icacls "C:\Users\junkwong\AppData\Local\Temp/postgresql_installer_c7c2d91f40" /T /Q /grant "atrapa\junkwong:(OI)(CI)F"
Script exit code: 0

Script output:
 Successfully processed 1 files; Failed processing 0 files

Script stderr:
 

Executing C:\WINDOWS\System32\cscript //NoLogo "C:\Users\junkwong\AppData\Local\Temp\postgresql_installer_c7c2d91f40\prerun_checks.vbs"
Script exit code: 0

Script output:
 The scripting host appears to be functional.

Script stderr:
 

Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 Base Directory. Setting variable iBaseDirectory to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 Branding. Setting variable iBranding to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 Version. Setting variable brandingVer to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 Shortcuts. Setting variable iShortcut to empty value
[17:52:01] Using branding: PostgreSQL 14
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 SB_Version. Setting variable sb_version to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 pgAdmin_Version. Setting variable pgadmin_version to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 CLT_Version. Setting variable clt_version to empty value
Could not find registry key HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-14 Data Directory. Setting variable server_data_dir to empty value
Executing C:\Users\junkwong\AppData\Local\Temp/postgresql_installer_c7c2d91f40/temp_check_comspec.bat 
Script exit code: 0

Script output:
 

Script stderr:
 

Exiting with code 1

而且COMSPEC变量确实是设置为系统变量,而不是用户变量,就像许多帖子所提议的那样。此外,没有尾随分号(;)

我尝试过的:

  1. 我已经在命令提示符上运行了"%COMSPEC%" /C "echo test ok",并获得了"test ok“作为结果请看这里
  2. 在Administrator cmd上运行安装。
  3. 安装不同版本的PostgreSQL,包括14.2.2、14.3.1和13.7.1 (都会产生相同的错误消息)
  4. 试用了Prayash提出的解决方案,但没有找到Command Processor文件Postgresql 9.4安装/Windows8.1/ COMSPEC问题
  5. 试过这个安装PostgreSQL 9.2时遇到的问题。但是建议的路径中没有bitrock_installer_xxxx.log

非常感谢您的帮助或建议。

祝你今天愉快。

致以敬意,

君康

EN

回答 5

Stack Overflow用户

发布于 2022-07-12 13:48:43

  1. 在命令提示符下运行以下命令: disable8dot3 1行为集
  2. 重新启动电脑。

这是https://learn.microsoft.com/en-GB/troubleshoot/windows-server/performance/stop-error-code-0x00000019的一个解决方案,它对我有效。

票数 4
EN

Stack Overflow用户

发布于 2022-06-06 11:40:59

嗨,我遇到了同样的问题,但是后来我把CompSpec的环境变量更改为: ComSpec和path: C:\Windows\system32\cmd.exe,并重新启动了我的pc并成功地安装了它。希望能帮上忙。

票数 1
EN

Stack Overflow用户

发布于 2022-06-07 15:54:35

我也有同样的问题到处找。我试了很多次,但终于找到了一个可行的解决方案。这个问题似乎与8.3文件名的处理有关。我跟踪了提示:https://hub.alfresco.com/t5/alfresco-content-services-forum/solved-installation-error-on-windows-10-x64-registerservice-bat/td-p/209616

或者直接去

https://support.microsoft.com/en-gb/help/121007/how-to-disable-8.3-file-name-creation-on-ntfs-partitions

与指南相比,我的默认注册表项是2,而不是0。无论如何,将其更改为1(+重新启动)允许COMSPEC-测试通过。似乎是“安装脚本”和"Win10“的问题.

/Björn

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72271531

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档