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

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