2
echo ping localhost -n 4 > nul >>TEST.bat

When I print this in a .bat file, for example, the "> nul" disappears. How can i just print "> nul" as a string way?

Pang
  • 9,564
  • 146
  • 81
  • 122
N. Mansch
  • 25
  • 1
  • 5

1 Answers1

1

To esacpe > or < or | just add the carret ^

@echo off
Color 0E
(
    echo cls
    echo @echo off
    echo Color 0B
    echo echo Please Wait a while ....
    echo ping localhost -n 4 ^> nul
)>TEST.bat
cls
echo.
echo Type any key to read the contents of your new batch file
pause>nul
echo.
Type TEST.bat
pause>nul
cls
echo.
echo Type any key to execute your new batch file ...
pause>nul
TEST.bat
Hackoo
  • 18,337
  • 3
  • 40
  • 70