Due to the simplicity and high efficiency of the command line, we often love to use the command line to complete many operations. However, the system comes with a variety of inconvenient command lines, such as many commands come with Y / N switch, these commands need to manually enter Y / N to complete, if you install the command line will have to enter the installation directory to run, etc. . Let's take a look at how to run the command line more efficiently.
Unfamiliar and fearless, automatic completion command
The command line needs to input specific commands to complete the operation. Many of the friends are not very familiar with the commands. Therefore, when they are actually used, they will encounter various problems. For example, only the first half of the command can be remembered and the complete command cannot be remembered. Now we can achieve efficient input of commands through automatic completion methods.
Windows 10 has its own command auto-completion function, start the command prompt as long as the input part of the command, and then press the Tab key to automatically complete, for example, enter "take", then press the Tab key to automatically complete the " Takeown.exe" command (Figure 1).
Figure 1 can be completed automatically by pressing the TAB key
However, if there are many related command prefixes, the automatic completion of the system TAB key does not allow us to quickly obtain the corresponding command. To automatically complete common commands, you can now use PYCMD for better completion. For example, there are many net commands, the system comes with a complete list of .dll files, and each presses the TAB key to display a file, PYCMD presses the TAB key, and then lists all net start commands (prefix Highlighted), we just need to select according to our actual needs (Figure 2).
Figure 2 Pycmd will list all the commands
Move closer to the GUI and use the graphical interface command prompt
The command prompt uses a dark command-line interface by default, which makes a lot of friends who are accustomed to graphical programs unable to adapt. For example, we often want to copy some commands. At the command prompt, we can't right-click and select “Copy†as we did in regular graphical programs (such as Word, Notepad). After selecting, right-click on the title bar. The menu can be selected for copying (Figure 3).
FIG 3 the command prompt, copy / paste operations inconvenience
Now with Powercmd, we can perform many common operations like traditional graphical program windows. For example, if you want to copy the commands after running Powercmd, right click to select "Copy", and you can also perform common operations like saving and adding new windows (Figure 4).
4 using the conventional method of FIG Copy / Paste
Of course, Powercmd can also use multi-tab (even multi-window) startup commands like a browser, which is very convenient when executing multiple commands, unlike the system's own command prompt window, which can only execute one command per machine (Figure 5). ).
Figure 5 Powercmd can multi-label (multi-window) View
Run any command at high speed, custom environment variables
We all know that the system comes with the command, we can enter the command name directly in the command prompt window (or run box) can be started, but the command line software you downloaded can not be so quick start. If you want to download the command you can also start as quickly as the system built-in commands, you can now configure the environment variables.
For example, the above pycmd author is installed in the "C:\Users\yumufa\Desktop\PyCmd", now to achieve in the run box or any command prompt window can be directly input "pycmd" start. First enter the "Environment Variable" directly in the taskbar search box, click "Edit Account Environment Variable", select the "Path", click "Edit", and then enter the pycmd installation path at the variable value (if the original value, Separate multiple paths by semicolons, Figure 6).
Figure 6 Adding Environment Variables
In this way, we can quickly start the command line by typing “pycmd†in any path under “Run†or the command prompt. In the same way, we can quickly start any program (Figure 7).
Figure 7 Quick start commands after adding environment variables
Add parameters manually, the command automatically responds
As mentioned above, many commands have Y/N switches. By default, manual confirmation is required to complete the command. So if we want to make a batch, or run multiple commands quickly, then we can't automatically run the command. For such commands, you can now do this by adding a parameter method yourself.
For example, to rename files in the Windows 10 system directory, we can use takeown to change the file ownership, and then use cacls to obtain full control permissions, but when using cacls to get file permissions changes, the system will pop up a Y/N query to complete the operation (Figure 8).
Figure 8 cacls command line needs to confirm Y|N
If you want to accomplish the change of the file owner and permissions at one go, we can use the "Echo y|" parameter to achieve automatic confirmation. For example, you need to obtain “C:\windows\system32\osk.exe†permissions, start Notepad and create the following batch:
takeown / f C: \ windows \ system32 \ osk.exe
ECHO Y|cacls C:\windows\system32\osk.exe /g administrators:f
In this way, when the above batch processing is executed, since the channel symbol “|†is used here, the previous command execution result information is sent to the next command processing, so that the cacls command can directly respond to the Y operation ( FIG. 9 ).
Figure 9 can directly respond after adding a pipe character
hint:
There are many parameters such as pipelines, and we can use them flexibly according to our own needs. For example, we need to use the dir command to output the screen to a file, you can use ">" + file name to achieve, to output the result again, use the ">>" to achieve.