###### tags: `ESP32` `Arduino` # ESP32 在 Arduino 編譯遇到 exec: "cmd": executable file not found in %PATH% 在 Windows 上的 Arduino 編譯 ESP32 專案時, 會需要執行 cmd.exe 程式, 不過可能因為安裝特定軟體或是進行測試的關係, 有些人的 Windows 環境中 Path 環境變數的內容被修改了, 導致包含 cmd.exe 程式檔的 C:\Windows\System32 路徑並不在 Path 環境變數的內容中, 就會出現以下的錯誤訊息: ``` exec: "cmd": executable file not found in %PATH% ``` 表示找不到 cmd.exe 執行檔。解決方法很簡單, 把 C:\Windows\System32 手動加回 Path 環境變數中就可以了。請開啟『**設定/系統/系統資訊**』, 再點選**進階系統設定**:  再按**環境變數**:  選取**使用者變數**或是**系統變數**中的 Path 項目, 按一下**編輯**:  把 C:\Windows\System32 填入後一路按**確定**即可。接著關閉 Arduino 再重新開啟後就可以正常編譯了。
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up