Reputation: 47
I have a problem like this. Suppose I want to write this code to a text file.
echo taskkill /IM wscript.exe /F > null
How can I do it?
Thanks to vendettamit, Matteo Italia and Roger Lipscombe :)
Upvotes: 0
Views: 561
Reputation: 14677
Try this:
ECHO taskkill .IM wscript.exe /F ^> null > yourFile.txt
Upvotes: 3
Reputation: 126787
In batch the caret (^
) is the escape character; thus:
echo taskkill /IM wscript.exe /F ^>null >file.txt
by the way, I suppose you meant >NUL
(>null
will just write the data in a file named null
).
Upvotes: 5