Computer

Best CMD Tricks for Windows

To always run CMD with administrator permissions, we go to the Windows search box, type CMD and click on Open file location. Next, we click with the right mouse button and access properties.

cmd admin

Within properties, on the Shortcut> Advanced Options tab, we check the Run as administrator box.

Create a document with the files in a directory

Creating a text document with the name of all the files that are part of a directory through CMD will allow us to list all the files included in a project in a much simpler way. This way, it will be much easier to check if all the files are included. To do so, we can use the following command:

dir /b >listado.txt

this code will create a plain text document called list.txt that will include a list (forgive the redundancy) with all the files, archives and directories, which are found in the directory where we have executed the command.

From CMD to clipboard

Copying the text that is displayed on the command line after executing actions is a practically impossible mission if we are not used to it and have established a suitable routine. Fortunately, for this problem, there is a solution using the variable “| clip” next to the command.

For example, following the previous example, if we want the list of files from the previous example to be copied directly to the clipboard, we use the command from the folder where the files are:

dir | clip

Next, we open the application where we want to add the generated list and click on the Paste button. The symbol | will appear by pressing Alt Gr + 1.

Scan your hard drive for errors

Using the sfc command, the computer analyze the integrity of the files checking if there are damaged sectors, sectors that it will take care of repairing and will create a log file with all the repairs it has made.

sfc /scannow

cmd sfc

If the drive shows a large number of errors and you can’t fix them all, it’s time to change the hard drive if you don’t want to lose the files stored on it.

Hide a file in an image

A functionality that for many users today may be attractive is the possibility of hide a file inside an image. In this way, at first glance they open with any photo application, but, if you use the application of the file that hides, for example, Word, you will be able to access the text of the document if we have merged a Word document with an image. If we want to hide the document softzone.doc inside the image vacation.png creating the resulting file hello.png we use the command:

copy /b softzone.doc+vacaciones.png hola.png

Opening the hello.png document with any photo application will display the image included in the vacation.png file. If we open the file with Word, the text included in the softzone.doc file will be displayed.

What programs do I have installed?

CMD also allows us to create a list with all the applications that we have installed on our computer using the command

wmic product get name

cmd list installed applications

But we can also uninstall apps installed on the computer, although it is not a very intuitive process using the command:

wmic product where nombre-completo-de-la-aplicación call uninstall /nointeractive

By having to enter the full name of the application as it has been listed, uninstalling applications from CMD is not a recommended process and, by no means, fast.

Stops the execution of a command

Although the Esc button is the usual one for cancel a process throughout its execution, on the command line, it does absolutely nothing. If we want to stop an action, we must use the key combination Control + C.

What does each command do?

One of the most repeated commands when I was introduced to the world of MS-DOS computers was including the /? variable. in each and every one of the .exe and .com commands it encountered on the system. When entering this command behind an application, it displays Every options that the application offers you according to the variables that we introduce after its name.

dir /?

cmd help

Using this command, the system will show us all the options available for the command say which shows a list of files.

Function keys are keyboard shortcuts

The function keys at the top of the keyboard, above the number line, are keyboard shortcuts from the command line. Each of the function keys is assigned different functions, although some are similar.

  • F1: When pressing this key, the last command that we have executed will be shown again, letter by letter.
  • F2: Copies the displayed command up to a specified character.
  • F3: Shows the complete previous command.
  • F4: Clears the displayed command up to a specified character.
  • F5: Every time we click on F3, the last commands used will be displayed.
  • F6: Enter the EOF flag in CMD.
  • F7: Shows a list of previously entered commands.

The use of these keys is especially useful considering that the copy and paste commands, as I explained above, is not an easy functionality to use on the command line.

Change the title of Command Prompt

When we open CMD, at the top of the window the text is displayed Administrator: Command Prompt either Command Prompt if we execute CMD without administrator privileges. if you open different instances of CMD to perform different functions, changing the title of the window will allow you to identify it more quickly. Using the command

title softzone

cmd title window

The window will be renamed from Command Prompt to Softzone. This change will be removed once we close the command window.

What drivers do I have installed?

If your computer is experiencing a problem with the drivers and you prefer to find the solution through the command line, you can use this command to display a list with all the drivers installed on your computer.

driverquery /fo list /v

This list shows us the location of the driver on the computer, if it is running or stopped, the space it occupies on the computer, the date of the file, among others.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *