I have a batch script that's running a command that should forward the result to a file:
start cmd /k "tasklist | find ^"Notepad^" ^> ^"C:\Users\Improvise\Desktop\notepadDeets.txt^""
The following works in the cmd prompt:
tasklist | find "Notepad" > "C:\Users\Improvise\Desktop\notepadDeets.txt"
In this script, the command will work like so:
start cmd /k "tasklist | find ^"Notepad^""
But when I try to add the > "C:\Users\Improvise\Desktop\notepadDeets.txt".
With ^> the error msg is:
Access denied - >
With > the error msg is:
FIND: Parameter format not correct
Am I not escaping this character correctly? Why does it not work in the batch script, and how can I get it to work?