Restore bat from backup. Backup The Bat! and mail file recovery. Backup using WinRAR

29.03.2020 SSD drives

We continue to study the mail program The Bat! In this tutorial we will look at backing up and restoring mailboxes along with all the settings, search capabilities and (hot key).

Backup

In previous lessons we studied But when you reinstall the system or run the program on another computer or laptop, it becomes necessary to reconfigure sending and receiving mail for each mailbox, automatic sorting, letter templates, etc. The task becomes especially complicated when there are many mailboxes and they are registered on different mail services. Is being decided this problem backup, thanks to which you can not only restore everything email settings boxes, but also all incoming and outgoing letters in these boxes.

Let's look at the procedure for creating and restoring backup copy The Bat! using screenshots. The picture below shows where the corresponding menu items are located.

To create a backup copy, select the menu item of the same name and in the next window set the path and name of the future archive by clicking on “Browse”. If necessary, we write a comment on the archive.

IMPORTANT! When specifying a location to create an archive, select a disk other than the system one, since the archive may be overwritten when the system is reinstalled. For example, if the system is located on drive “C”, then indicate the location for the archive to “D”, “E” or on a flash drive.

After clicking “OK”, a window will appear in which you can select all or individual mailboxes for archiving. You can also set a password for the archive if necessary.

After clicking “OK” again, the process will start Reserve copy The Bat!

To restore from a backup, select the appropriate menu item (see the first screenshot). Next, click “Add” and find the archive created earlier. Then click “OK”. In the next window, select the mailboxes to be restored and click “OK” again. We wait for some time and enjoy the result

By the way, if you use the portable version of The Bat!, located not on system disk, then after reinstalling the system, the mail client will not need to be restored at all - it will be immediately ready for use. You just need to re-create the shortcut to the executable file on the desktop.

Search in The Bat!

Email client The Bat! has a powerful search using fine tuning parameters of the information you are looking for. If you have a dozen mailboxes and hundreds or even thousands of letters in them, then this tool is simply irreplaceable.

Here are the search criteria you can customize:

1. Calling the search window
2. Search terms. You can select the following options:

  • text
  • sender (email)
  • recipient (email)
  • title
  • note
  • Attached files
  • any part

3. Delete a condition
4. Add a new condition
5. Selecting the “AND”, “OR” parameter
“AND” - all specified conditions must be met
“OR” – at least one of the specified conditions must be met
6. Selecting boxes and folders to search
7. Start searching
8. Advanced search - makes it possible to set search parameters even more precisely. For example: letter size, letter attribute (status), statute of limitations, time interval and other criteria. I will not consider this mode. Everything is intuitive there, I think you’ll figure it out.

Let's look at two search examples:

Example 1. Let's say we need to find all letters with the phrase in the subject “Windows 7 lesson” or “Windows 7 lesson” (we don’t remember exactly). We will search in all mailboxes. The search setup will look like this:

Example 2. It is necessary to find a letter from the author (sender) D. Pecherkin, which contains the phrase “how to make money in affiliate programs” in the text, but does not contain the word “newsletter”. It is also known that the letter is in the Yandex mailbox. The settings will be like this:

Hotkeys The Bat!

Mail program The Bat! has a set for quickly calling a particular function. Here are the most commonly used combinations:

  • create a letter - Ctrl+N
  • get new mail- F2
  • get mail for all mailboxes at once - Alt+F2
  • send mail - Shift+F2
  • mailbox properties - Alt+Enter
  • quick response to a letter - Ctrl+Enter
  • calling a template - Ctrl+space
  • creating a sorting rule - Shift+Ctrl+F
  • search - F7
  • address book - F8

See all The Bat hotkeys! can be found in the program menu opposite the corresponding commands.

The program also has the ability to set your own hotkey combinations through the “Properties” / “Settings” menu / section “Other options” / “System keys”.

That's all I wanted to tell you about for now mail program The Bat! I hope the information in this lesson will be useful to you and will help you work more productively with this wonderful program!

Today we will learn about what it is bat file and at the same time we will create one of them.

I think that many, one way or another, periodically create (so-called backups) of certain files and folders.

Everything seems to be familiar and you don’t need to do anything particularly complicated: insert a flash drive, open “My Computer”, find what you need to copy, select, click with the mouse, select “copy”, move to the desired directory, click “paste”, etc.

But often all these clicks and unnecessary movements are somewhat tiring and take up valuable time, especially when frequently copying the same data. In this article I will tell you how, or rather, how to write such a thing as a bat file.

Go.

Bat file - what's what, introductory

First, a little about what a bat file is, why it is needed and what it (or them) is used with. In order not to reinvent the wheel, I will use an excerpt from Wikipedia:

Batch file (i.e. bat file, from the English batch file) - text file in MS-DOS, OS/2 or Windows, containing a sequence of commands intended to be executed by the command interpreter.

After launch batch file, an interpreter program (usually COMMAND.COM or CMD.EXE) reads it line by line and executes the commands sequentially.

A batch file is analogous to a shell script in Unix-like operating systems.

Batch files are useful for launching applications automatically. The main area of ​​application is automation of the most routine operations, which a computer user regularly has to do.

Examples of such operations include: processing text files; copying, moving, renaming, deleting files; working with folders; archiving; creating database backups, etc.

Batch files support the if and goto statements (and in Windows NT family systems, the extended for statement), which allows you to process the results of executing previous commands or applications and, depending on this, further execute this or that block of commands (usually, if the application completes successfully returns 0 in the errorlevel variable; if unsuccessful, 1 or greater).

Batch files in DOS have the extension .bat; for other operating systems they may have different extensions - for example, .CMD in Windows NT and OS/2, or .BTM in 4DOS or similar shells.

Now that we've sorted out the theory, let's get down to the actual practice, namely creating a bat nickname.

How to create a bat file and use it

Let's prepare a small test field so that we have something to experiment with. Open my computer and create a test folder on the C:\ drive. Go into it and create a folder in it.

Throw files there (5-10 pieces) - photos, documents, etc., etc. (anything shorter). The field for experimentation is ready. Next, we need to create, in fact, the bat file itself, by clicking on which we will copy the C:\test\testcopy folder to, say, the C:\test\backup folder. There is no need to create a second folder (which is backup) - it will appear automatically.

Creating a bat is very simple. Right-click where we want to create it (the location is not important - you can directly on the desktop) and select "Create" - " Text Document".

Give the created file a name and open it with notepad or any other text editor. Those. At the moment we have an open text file, which is called, say, copying.txt.

Add a command to the file, for example, to copy

Next, in fact, we need to enter a command into this file that will be played using the console (cmd) when this file is launched. In this case, we will use the xcopy command because it allows you to copy files, directories and subdirectories. Considering all the paths, we get the following command:

xcopy C:\test\testcopy C:\test\backup /f /i /y /s

Let me explain what's what:

  • xcopy is the command itself;
  • C:\test\testcopy is the source, i.e. the folder from which files and directories are copied;
  • C:\test\backup is the result, i.e. the location where files and directories will be copied;
  • /f /i /y /s - Extra options syntax for the xcopy command (see syntax below).

The number of lines can be any, i.e. if you need to copy 100 folders, you write 100 lines in one file and change only the paths in them.

What are there (i.e. those that I indicated in this example):

  • /f - displays the names of the source files and the result files during the copying process
  • /i - creates a new directory if it is not in the final path
  • /y - overwrites the file if it already exists
  • /s - copies directories and subdirectories if they are not empty. If the /s option is not specified, the xcopy command will only work on one directory.

As for me, this is the main list of parameters necessary for “silent” copying, i.e. without unnecessary questions about rewriting, creating directories and other riffraff. Regarding the rest of the syntax, you can read, for example, .

Change the file format and try to run it

First, open "My Computer", go to "Tools" - "Folder Options" - "View" and uncheck " Hide extension for registered file types".

Click "Apply" and "Ok". Now we can change the extension of files known to the system, and therefore we go to our file, right-click, select “Rename” and by typing on the keyboard change the extension from txt to bat (we answer the system’s question whether this is worth doing in the affirmative).

As a result, we have the following picture (in your case the file is called differently, but has the same format):

Actually, all that remains for us is to launch this file by simply clicking on it with the mouse.

If you did everything correctly, then the console will flash in front of you and a new folder will appear along a known path with a predetermined name and files inside copied from a folder known to you, i.e. the picture will be something like this:

Well, or slightly different, depending on what paths and folder names you specified in the command.
You can edit the file by changing its extension back to .txt and opening it with any text editor.

Afterword

As I already said and you yourself probably realized, using a bat file like this often saves a lot of time, i.e. you write it once and periodically launch it with one click, and instead of many minutes of clicking with the mouse and crawling through all the folders, you get an automated copying process.

If you wish, you can set this bat nickname to run on certain days through the Windows scheduler (or other programs that allow you to do this) and generally forget about the problem of long manual backups.

If you have any questions or problems, ask. As always, I will help in any way I can;)

PS: If my memory serves me right, then this is a piece of a topic from smart admin books, namely from the section " Administration automation".. so you can be proud of yourself :)

  • I will describe and give examples of creating backups using the command line.
  • I will describe in detail the xCOPY command and how to use WinRar to create a backup.
  • Create an archive folder with the name: current date.

I will quote bash.org.ru:

Year after year, new administrators back up server screws on logical partitions of the same screws.

Backup using xCOPY

Example script copying files to a directory f:backupnew, on the second launch, renames the directory new V old, recreates the directory new and copies files. Those. The batch file makes it possible to store “two-day” backups:

del “f:backupold” /s /q

Rmdir “f:backupold” /s /q

Rename “f:backupnew” “old”

Mkdir “f:backupnew”

Xcopy “D:123*.*” “f:backupnew*.*” /E /F /H /R /K /Y /D

You can do it differently, for example the command md %date:~0.2%.%date:~3.2%.%date:~6.4% creates a folder whose name is the current date:

mkdir“f:backup%date:~0.2%.%date:~3.2%.%date:~6.4%”

xcopy“e:superBD*.*” “f:backup%date:~0.2%.%date:~3.2%.%date:~6.4%*.*” /E /F /H /R /K /Y /D

rem It should work without mkdir, because xcopy would create the folder itself. Safety net =)

Let me explain the XCOPY keys used:

/E Copies all subdirectories, including empty ones.

/F Displays the names of the source and result files during the copying process.

/H Includes hidden and system files. By default, system files are ignored.

/R Copies files with the read-only attribute.

/K Copies files with a read-only attribute, preserving this attribute for copied files whose originals have this attribute.

/Y Eliminates prompting for confirmation to overwrite an existing target file.

/D[:mm-dd-yyyy] Copies only files modified on or after the specified date. If you do not include mm-dd-yyyy, the xcopy command copies all source files that are newer than existing result files. This feature allows you to update only changed files.

About additional keys xcopy you can read it at

Backup using WinRAR

del “f:backupold” /s /q

Rmdir “f:backupold” /s /q

Rename “f:backupnew” “old”

Mkdir “f:backupnew”

“C:Program FilesWinRARRar.exe” a -m5 -r -t -dh -idp f:backupnewbackup.rar “D:superBD*.*” >> f:backupnewbackup.log

If you attach the above described %date:~0.2%.%date:~3.2%.%date:~6.4%, That

“C:Program FilesWinRARRar.exe” a -m5 -r -t -dh -idp f:backup.rar “E:superBD*.*” >> f:%date:~0.2%.%date:~3 ,2%.%date:~6.4%.log

Ren “f:backup.rar” “%date:~0.2%.%date:~3.2%.%date:~6.4%.rar”

I deleted the log files

More about launch keys Rar.exe you can read it in the file C:Program FilesWinRARRar.txt

After the batch file has been created and verified, you can create a task to run automatically, for example at night, when the user is sleeping. Click startexecute– enter control scheduled tasks- press enter. The task scheduler will open, it couldn’t be simpler.

Good luck!

ZY Do not back up the same screws on logical partitions.

If you use an email client to work with mailThe Bat! , then you probably came across the automatic reservation function. Program on a specific day and certain time(which are set in the settings) begins to create an archive with data at the most inopportune moment.

I don't see anything wrong with this process. But if you have a computer with minimal performance (and this is most likely the case, since programs of this type are most often used in offices), then at the most inopportune moment The Bat! launches its clumsy operation, which “freezes” the computer.

It is not easy to cancel the archiving operation at the moment; it simply freezes. Even to close it, you need to call the device manager (key combination Ctrl + Alt + Delete).

Therefore, it is better to change the time at which the archive will be created or turn it off completely. In the latter case, archiving will have to be started manually.

To go into settings, open . There we find the point "System" and uncheck the box opposite “Copier. Every".

If you need to configure backup, in particular, specify the location where the archive is saved, configure what needs to be archived and other parameters, you need to go to “Properties → Settings → System” and press the button "Additionally". There in the tab "Are common" select the directory in which the backup copies will be saved, and also note what to copy (mailbox properties, mail folders, address books, user settings, files attached to letters).

At the bottom of the same window, select the mailboxes that will be processed (if you have several), as well as address books.

Tab "Additional" allows you to set a password for the archive. This way you can be sure that no one but you will be able to use personal letters and information contained in the archive.

Tab "Folders" allows you to specify folders for processing. By default, all are selected.

Anyone who is not yet familiar with the The Bat! email client can do so using the link below.

The Bat!—program No. 1 for working with by email. This program has many victories in various tests. This email client supports all possible protocols and encryption methods. The client is easy (for most popular postal services almost automatically, you only need a login and password) is customizable and requires a small amount of system resources and, according to my observations, better displays the contents of letters and correctly synchronizes with the server. Works with IMAP4, POP3, APOP, SMTP, SMTP authentication protocols.

Read, how to use the built-in functions of the email client to backup, import and export data, as well as ways to restore them if they are lost. The Bat! is an email client for the Microsoft Windows operating system, which is positioned as an alternative option for advanced users.

In this article, we will describe how to use the built-in functions of the email client to backup, import and export data, as well as ways to restore them if, as a result of careless or thoughtless user actions, they are lost.

Content:


Where is The Bat mail profile data stored?

To understand the principle of working with data from The Bat email client and correctly understand the essence of the actions described in this article, let’s understand in what form and where the program stores the user’s email profile data.

By default, all The Bat data is saved in the following folder:

As is the case with other mail clients, in this folder The Bat stores configuration files and folders with mail profile data, including the user’s direct incoming and outgoing mail, these are:

In the shared folder The Bat:

  • account.flb– configuration file shared folders;
  • account.cfn– settings file for shared folders;
  • account.srb– filter file for shared folders;
  • *.abd– address book files;
  • accorder.cfg– a configuration file with the order of boxes in the folder tree;
  • addrbook.ini– address book configuration file;
  • avconfig.ini– configuration file of anti-virus plugins;
  • config.cdb– a file of settings for system hot keys, viewing modes, mail list tabs;
  • events.cfg– scheduler configuration file;
  • ex_log.txt– text file with error report;
  • smartbat.ini– SmartBat configuration file;
  • smartbat.txt– main notepad for SmartBat;
  • smimernd.bin– temporary encryption file (random number generation);
  • tbplugin.ini– configuration file for connected plugins;
  • tbuser.def– configuration file with interface settings;

In the folder with the name of the user's mailbox:

Folders whose names correspond to the names of mailbox folders, as well as files:

  • account.cfn– mailbox settings file;
  • account.flb– configuration file for folders inside the mailbox;
  • account.imp– IMAP debug configuration file;
  • Account_log.txt– text file, log of interaction with the server, processing of filters and other information;
  • account.srb– sorter configuration file;

In the folder with the name of the user's mailbox folder (Sent, Inbox, Trash...):

  • messages.tbb – folder mail database file;
  • messages.tbn – index file.

How to create a backup copy of The Bat mailbox

As already stated in the previous section, each mail profile that is connected to the The Bat mail client corresponds to separate folder. This folder contains a set of files with user settings and message data for a specific mailbox. In our case, as can be seen from the screenshot, two mailboxes with names are connected to the mail client "gmail.com" And "website".


There are two ways to back up your mailbox data:

Create a copy of a folder manually

You can manually create a copy of the mail forwarding database and save it to another location. When Windows reinstallation, or formatting hard drive with subsequent reinstallation of The Bat, the folder data can be transferred back to the folder with the mail client data.

For this:

    After installing the program, when you first start it, do not create a new mailbox, but close The Bat.

    Go to your mail client data folder
    C:\Users\UserName\AppData\Roaming\The Bat!
    and transfer the previously created copies of mailbox folders to it.

    Now, after launch, The Bat will not require the creation of a new mailbox, but will load data from copied folders, which are essentially mailbox profile folders.

    Using The Bat's "Backup..." (*.TBK) function

    The Bat has a built-in email client data backup tool. To back up your mailbox data using The Bat:


    As a result, an archive file with a user-specified name and extension will be created in the folder specified when creating the archive. *.TBK.

    You can restore mailbox data from a backup using the function. To do this, just select Tools / Restore from backup... and indicate to the mail client the location of the archive file.


    Function of Export and Import of letters

    In case the user intends to use another email client or vice versa, the user switches to The Bat after using another email client, the program provides a function Export And Import letters.

    A special feature of this function in The Bat is the ability to set the file format for exporting letters into it or selecting the file format for importing, as well as the ability to select in the Import Wizard the program from which the user wants to import letters.


    Import and Export of Address Book

    In addition to importing the email database, The Bat provides the ability to create a copy or transfer the address book from other email clients.

    To implement Import / Export need to:


    Recovering The Bat data using Hetman Partition Recovery

    The presence of The Bat functions described in the previous sections allows users to save all the data of their mailboxes in separate files certain formats, as well as export and import them between email clients or other applications. This is certainly very convenient, it allows the user to create a backup copy of their mailbox data and restore it if it is necessary to reinstall the program, reinstall operating system or formatting the disk.

    But what if you lose data files or files with a copy of The Bat data in one of the formats described above?

    Restoring The Bat (The Bat!) mail profile

    If The Bat mail profile is deleted as a result of reinstalling Windows or formatting the hard drive, you can restore it as follows:


    Recovering other The Bat data

    (backup copy of mailbox data (*.TBK), address book file (LDIF, vCard, INI, *.txt), Export / Import mail file (*.MSG, *.EML, *.mbox, *.TBB, * .MSB))

    Since the method for restoring other data from The Bat email client is the same, regardless of the file format, we will try to show the process of restoring such data using one example.

    For this: