Child lock
I think many visitors to the site have children. Everyone certainly has a computer. And now you just have to turn away, as the child begins to play on the…

Continue reading →

PC Recommendations
Now we will consider the question of choosing a personal computer (PC). Immediately it is worth noting that the examples below are taken from the price list of the DNS…

Continue reading →

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

Continue reading →

Bat files, examples

You can execute all the examples published below not only by creating and running a BAT file containing these commands, but by 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 virus folder is usually loaded into the folder with.

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 is launched 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 common 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
Photo of the product with the 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 contain the desired match. In quotation marks is a string whose coincidence you need 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
Photo of the product with the 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 in the list of commands (findstr /?) You will not find the one you need. 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 doing new projects, it becomes necessary to get a directory tree similar to the old project one, with the difference that there should be no 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

Causes and methods for resolving error 0x0000007b
If a problem 0x0000007b occurs, a blue screen appears on the monitor. The PC stops responding to any action. In some cases, a reboot may help. Such a problem often…


Cleaning your computer from dust
The topic Cleaning the computer (judging by the queries in the search engine) from the point of view of the user for the most part involves cleaning the garbage of the…


Apple iPhone OS
Preamble: Recently, all sorts of mobile and, especially fashionable, cloud technologies have captured the attention of mankind. Desktops and laptops faded into the background, giving way to more compact and…


Netbook Choice
Netbook, actually you could hear, or if you saw, decide that this is a laptop, just a small one. Actually, many stores throw them in one pile, but the netbook…