RE: sending files

"'Glenn B. Lawler' [email protected] [blat]" <[email protected]>
Newsgroups gmane.mail.blat
Message-ID <!&!AAAAAAAAAAAYAAAAAAAAAH3fQh0qW/pHjsDKJ3Hs9vDCgAAAEAAAABlH6TPID3hAgKy+jF82/[email protected]>
We developed a command line utility many years ago to handle things like this (and others) in batch files. Program is FileSize.exe and can be used in a BAT file like this:

--------------clip

REM If MyFile.pdf size is greater than 512, set ERRORLEVEL 1

FileSize.exe MyFile.pdf 512

IF ERRORLEVEL 1 GOTO SendIt

GOTO DoNotSendIt

 

:SendIt

REM Add code to send the file here

GOTO End

 

:DoNotSendIt

REM Add code to do whatever here

GOTO End

 

:End

--------------/clip

 

Another way to do this without a special program like FileSize.exe is to use a FOR in a batch file like this:

 

FOR %%F IN (MyFile.pdf) DO SET MyFileSize=%%~zF

The environment variable MyFileSize will be set to the size of MyFile.pdf

If you need further help with this approach, ask.

 

Glenn Lawler

www.incodesystems.com

 

From: [email protected] [mailto:[email protected]] 
Sent: Saturday, September 12, 2015 7:23 AM
To: [email protected]
Subject: [blat] sending files

 



I have been searching and have Not found an answer yet so I thought I would ask.  I don't know What version I am using but simply want to know is there a way  to only send a file like a pdf if it goes above a certain size? I have a report that only occasionally has information in it. I would like to be able to email it only when the report actually has results so as to keep from sending out Needless emails that people will eventually ignore.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.