Odd batch file error: Invalid argument / parameter: - 'eq'

I have a line of BAT code written as follows:

tasklist /FI "IMAGENAME eq WerFault.exe"|find /C "WerFault.exe" > temp.txt

This went on for quite a few days, but unexpectedly I received an error message:

error :Invalid argument/option: - 'eq'

The code was not changed before and after this error message, I can not understand what the problem is.

+4
source share
1 answer

You, or the people who came here from the search, may have been touched by the insane text encoding and border sabotage of cmd.exe behavior in combination with websites such as this .

What did they do:

  • Omit one quote
  • Replace another quotation mark with a Unicode character 201c

, , :

  • -
  • , , .
  • , , , Stackoverflow, , !. , !
  • copy-paste cmd ( ), .

:

, Unicode.

, cmd.exe . , .

, , , , .

+5

Source: https://habr.com/ru/post/1584634/


All Articles