Quantcast
Channel: CobianSoft
Viewing all articles
Browse latest Browse all 1880

Cobian Reflector • sending mail after the -autoclose command line

$
0
0
Hello,

I use Cobian Reflector when shutting down my computer.
I use a simple batch script that I added in the gpedit --> users --> windows --> logoff

here is the content of the script:

Code:

start /wait taskkill /im Cobian.Reflector.Application.exe /T /F"C:\Program Files\Cobian Reflector\Cobian.Reflector.Application.exe" -bu -nogui -autocloseexit
With the latest version (perhaps before because I don't update systematically...), it didn't work anymore.

I tested manually and it works but not sending mail (which must be done when the task ends).

For the task to start anyway I made another script that calls a .bat file.

By doing so the backup task is launched well (but the sending of mail is not done).

While waiting for a fix (or to see if it's me who made a mistake), I combine everything with SwithMail for sending the report.

Here is the content of my two bats then of a powershell which is launched when the computer is shut down:

Backup.bat

Code:

start /wait taskkill /im Cobian.Reflector.Application.exe /T /F"C:\Program Files\Cobian Reflector\Cobian.Reflector.Application.exe" -bu -nogui -autocloseexit[
Mail.bat

Code:

C:\scripts\SwithMailv2240\SwithMail.exe /s /x "C:\scripts\SwithMailv2240\SwithMailSettings.xml"exit
SwithMailSettings.xml

Code:

<?xml version="1.0" encoding="utf-8" standalone="yes"?><SwithMailSettings>  <ServerSettings>    <FromName>Backup *** Portable</FromName>    <FromAddress>***@***.fr</FromAddress>    <Username />    <Password>*******</Password>    <ObscurePassword>False</ObscurePassword>    <MailServer>smtp-mail.outlook.com</MailServer>    <MailServerPort>587</MailServerPort>    <SSL>True</SSL>    <Encoding />    <RequestReceipt>False</RequestReceipt>    <MessageID>False</MessageID>  </ServerSettings>  <EmailAddresses>    <To>***@***.fr</To>    <CC />    <BCC />    <ReplyTo />  </EmailAddresses>  <Attachments>    <AttachmentPath />  </Attachments>  <EmailContent>    <HTML>False</HTML>    <DontReplaceNewLine>False</DontReplaceNewLine>    <Subject>Backup *** Portable</Subject>    <Body />    <BodyTxtFile>C:\scripts\backup.txt</BodyTxtFile>  </EmailContent></SwithMailSettings>
backup.ps1

Code:

cmd.exe /C C:\scripts\backup.bat"C:\Program Files\Cobian Reflector\Cobian.Reflector.Application.exe" | Out-NullCopy-Item -Path "C:\Program Files\Cobian Reflector\Logs\*.txt" -Destination "C:\scripts\backup.txt"cmd.exe /C C:\scripts\mail.batRemove-Item -Path "C:\Program Files\Cobian Reflector\Logs\*.txt" -RecurseRemove-Item -Path "C:\scripts\backup.txt" -Recurseexit

Sorry for my English, I use Google Translate (I'm French :) )

Statistics: Posted by jojo11300 — 06 Mar 2022, 11:07 — Replies 1 — Views 22



Viewing all articles
Browse latest Browse all 1880

Trending Articles