banner



Blat Command Line Example Attachment

bank check

  • Ok I managed to solve the outcome.

    I changed the output from .txt to .log

    now its showing correct LOG file with required format (line by line, line suspension as showed in the original log file)

    Cheers all for the support.

    

    Was this post helpful? thumb_up thumb_down

  • View Best Answer in replies below

    xiii Replies

    • I have several of these running

      blat.exe bodyfile.html -to email@address -s field of study -server emailserver -f fromEmail@address

      Was this post helpful? thumb_up thumb_down

    • Utilise the following in your code:

      Text

                              -attach "C:\adhere.txt"                      

      Was this postal service helpful? thumb_up thumb_down

    • Otherwise, we need to know code language you're using....

      In that case, you basically would do a file open then read line by line and store in a variable (ie: myFile)

      then once the file is fully read, make that variable your trunk...

      Depending on the language, you can read the entire file instead of line by line to make your code shorter ....

      Was this mail service helpful? thumb_up thumb_down

    • Actually I am running a batch file daily which copies last date file from 1000:\database to file server shared binder. Information technology also creates a output file list.txt which shows which file was copied (for info purpose). I dont want to attache this file, instead I want this info to be shown in the BODY section.

      contents of listing.txt

      Book in drive Thou is DB
      Book Serial Number is 6EE4-xxxx
      Directory of g:\data
      ten/17/2014 02:46 AM 10,233,586,238 RT02647.R3P
      1 File(s) 10,233,586,238 bytes
      0 Dir(southward) 1,067,309,645,824 bytes free

      At present I want above data to exist inserted in the BODY , same as showed above line by line, how to do this ?

      Was this post helpful? thumb_up thumb_down

    • @GILESC, your suggestion worked, but it paste all lines in single line, and so its hard to read,

      Volume in drive G is DB Volume Serial Number is 6EE4-21A4 Directory of grand:\usr\sap\trans\data  10/17/2014 02:46 AM ten,233,586,238 RT02647.R3P 1 File(south) x,233,586,238 bytes 0 Dir(south)  1,067,309,645,824 bytes free

      how can I preserve the format similar line by line?

      Was this post helpful? thumb_up thumb_down

    • Do you lot have the ability to modify the text file which is generated? It looks like it needs different newline characters.

      Was this post helpful? thumb_up thumb_down

    • Ok I managed to solve the issue.

      I inverse the output from .txt to .log

      at present its showing correct LOG file with required format (line by line, line break every bit showed in the original log file)

      Thank you all for the support.

      

      Was this mail helpful? thumb_up thumb_down

    • Ane more matter to inquire.

      If I add the log file, then if I try to add together some text in body , and so log file doesnt show, which means merely 1 matter is working at a time. is information technology possible to to add together Torso text along with the file showing the torso likewise ?

      Was this post helpful? thumb_up thumb_down

    • Append the text you want onto the end of the log file.

      echo Some Text I Want To Add >> bodyfile.log

      IIRC, adding \r\n should put in a newline.

      Was this post helpful? thumb_up thumb_down

    • tin you provide the consummate blat command you used to browse the .log file and sending the content via email.

      Was this post helpful? thumb_up thumb_down

    • @ kapildev4 , here is the script i used at my company to get some customized result. deplorable for Very late respond...

      Text

                            @echo off cls echo This script is designed by Syed Jahanzaib / Company IS Dept. echo This script volition copy some data to file server  echo. rem # Syed Jahanzaib # rem ####################################################### rem Setting various Descriptions via surround variables rem ####################################################### setlocal enableextensions enabledelayedexpansion ready starttime=%time% prepare dt=%date:~-iv,4%%date:~-ten,2%%date:~-7,2% set up srvname=MYSERVER.LOCAL fix clarification=myserver_db_backup_log_in_mail gear up mail service-subject=MYSERVER.LOCAL - Daily Status of myserver DB Backup Copied in binder \\fileserver\datapark\myserver  set mail-body=myserver DB Files which are copied from the c:\backup to File Server ......  set mail-to="AACABLEATHOTMAILDOTCOM"  set footer="Automated_COMPANY_myserver_START_SCRIPT_Created_by_Syed_Jahanzaib_COMPANY_(Pvt)_Ltd.IS_Dept." set attachment=c:\scripts\myserverdb.log taskkill /f /t /im "sed.exe"  > null del c:\fill-in\COMPNAME.txt > null del c:\fill-in\ip.txt > naught del c:\fill-in\damwipfile.txt > null echo. > %attachment% echo. >> %attachment%   rem ######################### rem Offset END Time Algorithm rem #########################   ready endtime=%time% set full="echo Total   = %tot%"  set up /a hrs=%endtime:~0,2% set up /a hrs=%hrs%-%starttime:~0,2%  fix /a mins=%endtime:~3,2% set /a mins=%mins%-%starttime:~3,2%  set /a secs=%endtime:~6,2% fix /a secs=%secs%-%starttime:~6,2%  if %secs% lss 0 (     set /a secs=!secs!+60     prepare /a mins=!mins!-1 ) if %mins% lss 0 (     set /a mins=!mins!+sixty     prepare /a hrs=!hrs!-one ) if %hrs% lss 0 (     fix /a hrs=!hrs!+24 ) set up /a tot=%secs%+%mins%*60+%hrs%*3600  echo End     = %endtime% echo Start   = %starttime% echo Hours   = %hrs% repeat Minutes = %mins% echo Seconds = %secs% echo Total   = %tot%     rem listing file for mail service attention echo This script will copy concluding date added files from c:\backup to to File server \\fileserver\datapark\myserver binder > %attachment% repeat Automated Company myserver EXPORT SCRIPT  *****   Created by Syed Jahanzaib_COMPANY (Pvt) Ltd.IS_Dept. repeat ************************************************************* >> %attachment% echo Found Following File in c:\backup folder for copying to \\fileserver\datapark\myserver >> %zipper%  FORFILES /P C:\backup /Grand *.* /D -0 /C "CMD /C ECHO @FDATE @PATH - Size @FSIZE bytes - Modified Appointment @FDATE - Modified Time @FTIME" >> %attachment% repeat. >> %attachment% echo ***** Now Comparing to a higher place files with \\fileserver\datapark\myserver folder for verification >> %zipper% echo. >> %zipper%  rem ######################### rem Commencement BACKUP rem #########################  echo Executing Scripts Functions At present ... mapping network bulldoze net apply T: \\fileserver\datapark\myserver  rem # Copying Last Appointment Export files to \\fileserver\export folder FORFILES /P C:\backup /M *.* /D -0 /C "CMD /C re-create @path T:\"  FORFILES /P "T:" /Yard *.* /D -0 /C "CMD /C Echo @FDATE @PATH - Size @FSIZE bytes - Modified Date @FDATE - Modified Time @FTIME" >> %attachment% echo ************************************************************* >> %zipper% ping -n 2 127.0.0.1 > c:\nul  rem # Deleteing myserver DB files older then 15 Days from myserver server & file server as well. . . echo Deleting files in c:\backup and file server path older then 15 days  FORFILES /P C:\backup /M *.* /D -15 /C "cmd /c del @path" FORFILES /P "T:" /K *.* /D -15 /C "cmd /c del @path"   echo. >> %attachment% echo *** Files Older and so fifteen days from myserver and File Server (if whatever matched) take been deleted. verify it. >> %attachment%  echo. >> %attachment% echo. >> %attachment% echo %footer% >> %attachment%  rem ########## rem E-mail LOGS - You lot SHOULD HAVE BLAT installed rem ##########  rem c:\blat\blat.exe %zipper% -to %mail service-to%  -i %srvname% -s "%post-subject%" -body "%mail-body%| %attachment% Fill-in Report:|Showtime   = %starttime%|End     = %endtime%|Hours   = %hrs%|Minutes = %mins%||%footer%" c:\blat\blat.exe %attachment% -to %mail-to% -i %srvname% -southward "%mail-subject%" endlocal  rem ## THE END  rem ## Syed Jahanzaib / Visitor (Pvt) Ltd. / IS Dept.                    

      Was this mail helpful? thumb_up thumb_down

    • Was this mail service helpful? thumb_up thumb_down

    Read these adjacent...

    • Snap! Teams vuln, 365 Apps auto-updates, Starlink, AI concerns, & more

      Snap! Teams vuln, 365 Apps motorcar-updates, Starlink, AI concerns, & more

      Spiceworks Originals

      Your daily dose of tech news, in brief. Twenty-seven (27) years ago, arguably one of the best estimator high-tech thriller movies was released on September 15, 1995. Yep, I am talking about Iain Softley's Hackers! Of form, I am kidding nigh information technology be...

    • Monitoring remote user's login log out times and dates

      Monitoring remote user's login log out times and dates

      Windows

      Hey everyone,Doing some homework for a client and want to go your opinions on best way to do this. So recently got this visitor upgraded from their quondam servers to a new one running Server 2022. Due to the benefits they're seen for their employees being a...

    • How do you check PWD expiry?

      How do you check PWD expiry?

      Windows

      I know you tin utilise cmd prompt internet user %username% /domain.  Is there another method without having the user open the cmd prompt?

    • Spark! Pro series - 15th September 2022

      Spark! Pro series - 15th September 2022

      Spiceworks Originals

      Today in History: 1858 - The start transcontinental mail service service to San Francisco begins   On September 15, 1858, the new Overland Postal service Company sends out its starting time two stages, inaugurating government mail service betwixt the eastern and western reg...

    • Best Free Software

      All-time Free Software

      Software

      I just did a make clean install of Windows 7 Ultimate, and grabbed a few free essentials, here they are...VLC Actor: Plays merely about whatever mediaAudacity: Audio editorKdenlive: Video editorOpen Office: Full office suite (will not concur your documents hostage aft...

    Blat Command Line Example Attachment,

    Source: https://community.spiceworks.com/topic/607895-blat-email-tool-read-text-file-and-display-in-body-solved

    Posted by: parkerthavercuris.blogspot.com

    0 Response to "Blat Command Line Example Attachment"

    Post a Comment

    Iklan Atas Artikel

    Iklan Tengah Artikel 1

    Iklan Tengah Artikel 2

    Iklan Bawah Artikel