2016-03-27 1 views
2
echo ping localhost -n 4 > nul >>TEST.bat 

Wenn ich dies in einer .bat-Datei zum Beispiel drucke, verschwindet das "> nul". Wie kann ich einfach "> nul" als Zeichenfolge drucken? mit `^`Wie soll ich das in einer .bat-Datei drucken?

+1

Flucht carret hinzuzufügen. 'echo ping localhost -n 4 ^> nul >> TEST.bat' –

Antwort

0

Um Esacpe > oder < oder | nur das es ^

@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