| Newsgroups |
gmane.mail.blat |
| Message-ID |
<[email protected]> |
Try IF .%1. = .. GOTO END
--Original Message Text---
From: 'Chip' [email protected] [blat]
Date: Fri, 3 Mar 2017 15:01:40 -0700
> I´m building a backup.cmd batch file and trying to use the first argument
> in the batch file as parameter
> First i test if there is no parameter in batch file name:
> if "%1" == "" goto END
> so, every time the bath is used, i have to put a first argument, in my
> case, a 3-letter acronym like â¬Sabc⬠or â¬Sxyzâ¬
> the command line is:
> blat - -body "ERRO - %ROTINA%" -server %SMTPSERVER% -to %CXPOSTAL% -f
> %COMPUTERNAME%%@%DESTDOMAIN% -subject "Backup OFFSHORE MAXIMO em %DATE% de
> %COMPUTERNAME%"
> this example above Works well, but...
> if i try to use:
> -subject "Backup OFFSHORE MAXIMO de %1% em %DATE%â¬
> Thing get weird!,
> the subject is changed to â¬SContents of file: bakora_MAXIMO_sex_als.LOGâ¬
> insted my custom subject
> But..
> If i try to use %1% as the last parameter, things got more weird:
<snipped>
Batch command parameter %1% should be %1 instead. If you want to use more
batch command line parameters (%2, %3, etc.), these use only one % symbol.
Environment variables are represented with the % symbol at the front and end
like you did, but batch arguments use only one % symbol.
Chip
-----------
Jack Weaver, Webmaster (Ret)
The Fanac Fan History Project http://fanac.org