windows - odd batch file programming error :Invalid argument/option: - 'eq' -


i have line of bat code written this:

tasklist /fi "imagename eq werfault.exe"|find /c "werfault.exe" > temp.txt 

it went on quite few days got error message:

error :invalid argument/option: - 'eq' 

the code hasn't been changed before , after error message, can't figure out what's problem.

you, or people coming here search, may have been trolled text encoding madness , borderline sabotaging behavior of cmd.exe, combined websites such one.

what did:

  1. omit 1 quotation mark
  2. replace other quotation mark unicode character 201c

what's going on:

  • the user copy-pastes line , gets error
  • the user notices missing quotation mark , adds it
  • it looks identical other quotation mark, there's no way see going on.
  • not identical, copy-pasting out, such stackoverflow, replaces standard, undirected double quotation mark! in other words, indistinguishable correct symbol when copying out of window analysis!
  • the above true copy-paste within cmd (which conveniently doesn't work standard hotkeys) not bringing line via up-key.

what have once again learned this:

do not trust see when unicode involved.

also, cmd.exe not safe or sane. when in doubt, re-type command manually.

this might not cause here, if others come here same reason i, maybe answer save them few minutes.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -