如何在Windows命令行中回顯不同顏色我知道color bf命令設置整個命令行窗口的顏色,但我想以不同的顏色打印一行。
3 回答

暮色呼如
TA貢獻1853條經驗 獲得超9個贊
CALL:ECHORED "Print me in red!" :ECHORED %Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Red %1 goto:eof
編輯: (現在更簡單了!)
Powershell
這個 路徑
不需要指定,因為它應該已經在環境變量中了。 毫不含糊
命令可以是 ..例如,您可以: 使用 -fore
而不是 -foregroundcolor
使用 -back
而不是 -backgroundcolor
這個命令基本上也可以用來‘ 內聯
代替 echo
(而不是像上面那樣創建單獨的批處理文件)。
例子:
powershell write-host -fore Cyan This is Cyan text powershell write-host -back Red This is Red background
更多資料:
- Write-Host
- 3 回答
- 0 關注
- 1061 瀏覽
添加回答
舉報
0/150
提交
取消