Re: Blat saw and processed these options, and was confused by the last one
| Newsgroups | gmane.mail.blat |
|---|---|
| Message-ID | <51FA77DEB0D14C74B821575DCB38B2F6@chip> |
> Hi Blat Group, > > We are calling with the below script to send email notification. If %msg% > has Double quotes in the message it is failing and throwing an error like > below. > > Blat saw and processed these options, and was confused by the last one > > smail.exe "email" -t "%mc_email_recipients%" -s "%severity% alert on > %mc_host%" -body > "Severity=%severity%|Status=%status%|Message=%msg%|Address=%mc_host_address%|Parameter=%mc_parameter%|Object=%mc_object%|Owner=%mc_object_owner%|Parameter_Value=%mc_parameter_value%" > -log "D:\Emaillog\%mc_host%.log" -timestamp > > Blat v3.2.16 (build : Aug 7 2016 22:51:22) > > 32-bit Windows, Full, Unicode > > Blat saw and processed these options, and was confused by the last one... > > -t [email protected] > > -s CRITICAL alert on test81 > > -body Severity=CRITICAL|Status=OPEN|Message=test81.:[2016-10-31 > > 15:05:02.141] > > Do not understand argument: 15:05:02.141] This happens because you used quotation marks inside your environment variables rather than on the outside of your environment variables. For example: set msg="This is a message line with quotation marks." The above line should actually have been this: set "msg=This is a message line with quotation marks." Having the quotation marks around the whole environment variable and data allows the Windows command parser to pass the environment variable to Blat without the embedded quotation marks. Blat would then see the "Severity..." as one value. Chip