安裝postgresql時報(bào)錯COMSPEC does not seem to point to the cmd.exe or
(認(rèn)知有限,如有不妥,還望告知,歡迎討論。)
背景
OS:windows10
安裝包版本:14.4 [1]
OS 時間:北京時間
OS UI:英文(澳大利亞)
起始操作:以管理員身份運(yùn)行
完整報(bào)錯信息:
There has been an error.
The environment variable COMSPEC does not seem to point to the cmd.exe or there is a trailing semicolon present. Please fix this variable and restart installation.

解決方法
step1: 把OS UI轉(zhuǎn)成中文簡體(為了和時區(qū)保持一致),然后重啟電腦。
(可能這一步是不必要的,但如果做后面的步驟不起作用的話,則最好補(bǔ)做第一步)
step2:通過搜索進(jìn)入“查看高級系統(tǒng)設(shè)置”,選擇“高級”標(biāo)簽頁,點(diǎn)擊“環(huán)境變量”,新建一個用戶變量,
變量名為 COMSPEC
變量值為 <cmd.exe所在的地址的完整路徑> (這個可以在搜索欄里面搜一下cmd.exe就可以找到,我這邊的完整路徑是 C:\Windows\System32\cmd.exe?), 配置完后點(diǎn)擊“確定”,點(diǎn)擊環(huán)境變量窗口中的“確定”,點(diǎn)擊高級標(biāo)簽頁上的“確定”。重啟電腦。
step3:以管理員身份運(yùn)行運(yùn)行安裝包即可。
=reference=
[1] https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
[2] https://stackoverflow.com/questions/15287207/problems-installing-postgresql-9-2