Mozilla Firefox Web Browser Overview
For more than 10 years I have been using the "Firefox" browser in my daily work on my PC and have gained a decent experience, which I hasten to share.…

Continue reading →

The difference between Windows and Linux
A couple of years ago in one forum I, participating in one heated debate on the topic of whose swamp is better, published a post that will reveal the topic…

Continue reading →

Overview of modern antiviruses
Of all the threats to the security of user information, viruses stand apart. These small malicious programs, if not handled carefully, can steal or destroy any data. But it turns…

Continue reading →

Bat files, examples

You can perform all the examples published below not only by creating and running a BAT file containing these commands, but also copying them directly to the command line.

To open the command line in the right place (in the folder with files, for example), you need to call the context menu (RMB) with the Shift key held down:

command line call

You can read about how to work with the command line in this article. We pass directly to the teams.

A list of all console commands with a description can be obtained by typing help in the console
Help for any command can be obtained using the /?
For example: DIR /? displays help for all keys of the DIR command

Delete temporary files before shutting down your computer
I think everyone at least heard about sms viruses or came across them personally. The bat-file will help you to shut down the computer correctly by deleting temporary files, the folder with which the virus usually loads.

At the next boot of the device (at an early stage), the virus makes entries in the registry, disrupting the normal operation of the system. And when the desktop boots, the situation is more difficult to fix.

Of course, not all viruses work according to this scheme, but nevertheless, clearing temporary files and the system cache before shutting it down significantly reduces such risks.

start / wait “” “C: \ Program Files \ CCleaner \ CCleaner64.exe” / auto
start / wait “” “C: \ WINDOWS \ System32 \ shutdown.exe” / s / t 10
CCleaner is not installed by default on Windows. It needs to be installed separately. You can download the installer on the developer’s website.

The CCleaner program starts first and deletes all temporary files on the computer. Then the computer shutdown program starts with a delay of 15 seconds to avoid possible conflicts with CCleaner.

You must create a .bat file and copy this example into it. Display the shortcut to the bat-file on the desktop, assign it a beautiful icon and turn off the computer using this shortcut-button.

Get a list of files in a folder using a bat file
I periodically use bat-files to get lists of files in folders. A frequent situation: for work, clients send an archive with photos from the photographer. Photos are named according to the article numbers.

There is no textual information accompanying the photograph. You need to make a list based on the photos sent and import it into the product catalog on the site. For each product, several photos were taken. They are named like this:

Photo of the product with the article A1234.jpg
Photo of the product with the article A1234 (2) .jpg
Product photo with article B1234.jpg
Photo of the product with the article B1234 (2) .jpg
First, I get a list of all the files in the folder with the following command:

dir * .jpg / B / L> filelist.txt
The * .jpg command will allow only JPG files to be considered when compiling a list. The / B switch allows you to get a list containing only the names of the files in the folder. The / L switch will print all lowercase names. The command> filelist.txt will create a text file named filelist and write the result there.

The next step is to get rid of duplicates, so that only one entry is left in the list for each product:

type filelist.txt | findstr / I / V “(2)”> temp.txt
The findstr command will search the previously received file. The / I switch allows you to search for case insensitive entries, and the / V switch records lines that do not match the match. The quotation mark indicates the string whose coincidence you want to fix. And the last command> temp.txt will write to the temp file all the results that do not contain the name “(2)”. As a result, I get:

Photo of the product with the article A1234.jpg
Product photo with article B1234.jpg
And further on the basis of this text list I will prepare a file for import.

If you need to carry out the opposite operation – output only matches to the temp.txt file, then you will not find the needed one in the list of commands (findstr /?). There is only an inverse filter by exact match – / X.

For this task, you can use the command to output line numbers / N in which there are matches (numbers are displayed together with the line):

type filelist.txt | findstr / I / N “(2)”> temp.txt
The main thing when working with text information (text files) is to remember one thing:

If for text operations you use a file that you did not create through the command line as the source, it must be in the encoding that is understood by the command line. For example, CP1251 (ANSI).

Otherwise, you run the risk of getting something like this:

wrong encoding

Copy directory tree without files
When I start making new projects, it becomes necessary to get a directory tree similar to the old project tree with the difference that there should not be any files in it. For a new project, it is easier to add 3-5 files to the desired empty folders than to copy an existing project and then delete the unnecessary from there.

To get a directory tree without files, use the following command:

xcopy folder_1 folder_2 / T / E
The xcopy command takes as a basis the directory tree at folder_1 and creates a copy of it in the folder folder_2.

Forum Communication
The Internet has become an integral part of life. Since the Internet is an American invention, many terms have no direct analogues in the Russian language. For example, cookie. In…

...

How long can I sit at a computer?
Computing has become literally a part of life. Computers and tablets - it’s impossible to imagine a single day when only a couple of minutes were spent in front of…

...

Internet speed check (monthly statistics)
Checking the speed of the Internet is a fairly simple task if a single measurement is required. There are a ton of online tests on the Internet for this. But…

...

License Review Article
Before we talk about licenses, I would like to touch on the subject of licensing in order to clarify. So, licensing is most often designed to preserve the source code…

...