다음을 통해 공유


Be Weary of Stylish Fonts and Commandlines!

I see variations of this common "stylish" mistake all the time... so I will highlight it this one time.

Question:

Hi,

according to
https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/69a58513-141a-4adb-b6bc-2aaad4ea77b8.mspx?mfr=true

I would like to trace the executing requests in iis6, but when I execute the
logman start W3wpTrace –p “IIS: Request Monitor� -ets command, I get the
following error:

C:\>logman start W3wpTrace -p "IIS: Request Monitor" -ets
Unknown parameter "-p"
Unknown parameter ""IIS:"
Unknown parameter "Request"
Unknown parameter "Monitor""

The syntax of the command is incorrect.

We are running windows server 2003 web edition Sp1

Thanks.

Answer:

Ok, please don't strangle me, jump off a tall building, or thwap your forehead after reading my explanation of this one (though a "doh" comment or acknowledgement would be nice). :-) Don't feel bad; this one has stumped many people.

I think the URL you meant to reference is this one because the one from the question merely led me to a generic overview page.

In any case, your problem here is that the dash character in front of the "p" and the quote character around "IIS: Request Monitor" are stylized dash and quote characters and NOT the real ASCII dash (0x2D) and quote (0x22) used by logman.exe to delimit parameters and CMD shell to ignore space as parameter separator.

Yes, I know that you copied that commandline directly from the web page and pasted onto the CMD shell, and yes it all LOOKS fine, but believe me, the web page content has stylized quotes and dashes which do not work on the commandline.

Don't believe me? Verify it yourself. If you delete what appears to be the "dash" and "quote" characters and re-type the - and " characters on the keyboard onto the commandline, then I bet the command will work.

Yes, I can work magic! Where's my consultation fee? ;-)

The two tell-tale signs that tell me this "stylish" mistake happened?

  • The errors mentioned "-p" and ""IIS" as problematic. Since the real ASCII quote character escapes spaces (while the stylized quote does not), the fact that "IIS was considered the incorrect parameter means that the " was not interpreted as the real ASCII quote. Likewise, the real ASCII dash character delimits parameters, and the fact -p was considered incorrect means that - was not interpreted as the real ASCII dash.
  • The newsgroup post showed –p for "-p" and  “IIS: Request Monitorâ€?  for "IIS: Request Monitor", suggesting the stylized quote got converted and EXPOSED on the newgroup. This was the obvious sign.

Yeah, sneaky CMD shell. It uses a font that disguises the stylized dash and quote to look exactly like the ASCII dash and quote. Well, now you know. And knowing is half the battle.

Now, I consider this a bug in the documentation since commandlines should never use stylized quotes and dashes, but sigh, Documentation Writers use Word, which automatically changes things like this all the time... so it is a losing battle for me. Documentation Writers rarely use the commandline, so they have no idea how big of a mistake they are introducing. It is all just words and symbols to them, anyways.

So, I see this stylish mistake happen all the time, and I simply try to tell everyone about it.

//David

Comments

  • Anonymous
    June 17, 2006
    OMG........ wait I jump now..... :)
  • Anonymous
    June 17, 2006
    bernard - hehe... you are not the first to make this popular leap. :-)

    //David