19

It doesn't look like there is (just grey code blocks), but perhaps I am missing a way to trigger it.

5
  • 3
    According to this, no, there isn't.
    – user102937
    Commented Nov 13, 2013 at 23:10
  • Your command prompt doesn't even syntax highlight DOS commands. Why would you need an editor to color code that doesn't even have a defined set of colors? Just use <!-- language: lang-none --> and be done with it...
    – Aaron Bertrand Staff
    Commented Nov 14, 2013 at 2:37
  • 7
    Aaron: True, but most people's bash shells don't colorize anything either, yet there is a highlighter for bash.
    – Matt J.
    Commented Nov 14, 2013 at 7:33
  • @AaronBertrand my terminal has the option to colorized special words even though the shell itself has no similar function
    – phuclv
    Commented Jan 8, 2017 at 5:27
  • @AaronBertrand powershell does highlight the commands, unlike cmd.exe
    – phuclv
    Commented Nov 29, 2017 at 13:40

2 Answers 2

8

Use

<!-- language: lang-vb -->

Example

rem this is a comment
set here="is a string with spaces"
rem here are some keywords
call zulu
date zulu
do zulu
else zulu
erase zulu
exit zulu
for zulu
goto zulu
if zulu
in zulu
not zulu
2
  • 2
    But why? It seems illogical. Can you provide an explanation in the answer? Commented Jul 23, 2019 at 11:48
  • @P.Mort.-forgotClayShirky_q no DOS specific highlighter is available, but the VB one is similar
    – Zombo
    Commented Nov 13, 2021 at 17:07
-1

You can try lang-dos. It's a somewhat weak approach, but may be better than nothing:

@echo off
SET Var=Value
ECHO Var is now %Var%
"C:\Program Files\SomeCommand.exe" /?
IF NOT %ERRORLEVEL% EQU 0 ( EXIT /B 1 )
CALL OtherScript.cmd
REM etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .