Command Line Tricks & Tips

Get into the Windows command line

Open a Windows command line window by following the steps below.
  1. Click Start
  2. In the Search or Run line type cmd and press enter.
How to list available commands

Typing "help" gives you a listing of available commands with a brief description of each of the commands.

Drag and drop to the command line

When working with files with a long file path instead of typing the full path drag-and-drop a file into the command line. For example, let's say that you want to use the command line to copy the file picture.gif from the directory D:\programme files\files\examples\images\picture.gif. If you drag that file from the folder and drop onto the command line window, the text "D:\programme files\files\examples\images\picture.gif" will be inserted into your command.

View Windows command line history

While in the Windows command line, press the F7 key to view a history of all the commands that have been entered in that window.

Pressing the up or down keys allows you to browse through all commands and once highlighted pressing enter will perform the previous command.

Clear the clipboard through the command line

Clear anything in the Windows clipboard using the below command in the Windows command line.
1. Open the Windows command line.
2. From the Windows command line type the below command.
    
    echo off | clip

After the above command has been entered, all contents within the Windows clipboard will be removed.

Other clipboard commands on CMD

dir | clip
Places a copy of the current directory listing into the Windows clipboard.

clip < readme.txt
Places a copy of the text from readme.txt on to the Windows clipboard.

ipconfig /all | clip
Use the ipconfig command to display all network information and output the contents to the Windows clipboard.

Not only above commands As we know Windows command line is still used by many users. MS-DOS window more appropriately referred to as the Windows command line looks like running under Microsoft Windows.
Most computer users are only familiar with how to navigate Microsoft Windows using the mouse. Unlike Windows, MS-DOS is a command-line and is navigated by using MS-DOS commands. For example, if you wanted to see all the files in a folder in Windows you would double-click the folder to open the folder in Windows Explorer. In MS-DOS, to view that same folder you would navigate to the folder using the cd command and then list the files in that folder using the "dir" command.


Comments