Tim and Jason that really helps, thanks alot!
I am getting an error messege thats says
C:\ (file path) \backup??.log was unexpected at this time
what am I doing wrong. I have tried to save the .bat file in the directory
of the backup log and I get the same error.
-----Original Message-----
From: ***@yahoogroups.com [mailto:***@yahoogroups.com]On Behalf Of Tim
Musson
Sent: Wednesday, August 27, 2008 12:21 PM
To: jasonclamb
Subject: Re: [blat] Re: Using blat to send the last modified NTbackup log
Thanks Jason!,
Adam,
Here is the Batch file to play with (works on XP).
To simplify Jason's a bit and add a bit of explanation...
for /f %%i in ('dir backup??.log /o:-d /b') do (
blat -to ***@example.net -attach %%i
goto END
)
:END
"for" is a batch command that iterates through lists - in this case
the output of the dir command in the first ().
"/f" changes the behavior of the FOR command (use for /? for help)
"%%i" is the variable the FOR command will use.
"in" part of the FOR commands syntax
1st () Contains the list to process
The '' chars with the /f switch make the FOR command use the output of
the command inside the ''s.
"dir" lists files
"backup??.log" is a way of telling the DIR command to list all files
that have backup as the first part, anything for the
next 2 characters, and ending with ".log".
"/o:-d" changes how the DIR command lists files. Basically it is
listing them newest first (get help with dir /?)
"/b" tells the DIR command to only display filenames
"do" is the next part of the FOR command
2nd () this is what gets processed for each item matched in the first
set of () and put in the %%i variable.
"blat" this of course is the Blat command sending the file in the %%i
Variable
"goto END" is how we make sure that Blat is only asked to send the
first mile matched by the DIR command.
":END" is where the GOTO command goes in the processing of the batch
file...
--
Tim Musson
Flying with The Bat! eMail v3.99.29
I don't suffer from insanity; I enjoy every minute of it.
Blat Manager, current version is 2.6.2, see www.blat.net
[Non-text portions of this message have been removed]