How can I write > yes
to txt file by batch file
They have examples but they do not work
Example 1: echo > yes >> example.txt
Commande ECHO activ.e. Write a error message in the example.txt file
Please help where
-
or echo hellow >yes >> example.txt not work i want write hellow >yes – idir benyahia Feb 21 '19 at 15:43
-
the vbs work but batch file not work please help – idir benyahia Feb 21 '19 at 15:46
-
duplicate: How can I add greater than and less than into a batch file variable – phuclv Feb 21 '19 at 16:27
You need to escape the >
character. Otherwise it gets interpreted as a redirection operator. Escape it with the ^
character. This works:
echo ^> yes >> example.txt
See this page for more information about escaping special characters.
-
2@idirbenyahia Please see What should I do when someone answers my question? Accepting an answer is the best way to say "thanks, it works". – Kamil Maciorowski Feb 21 '19 at 16:10