«««The command line on Windows can do more than you think
in modern Windows versions as well as everything with the mouse works. But to give commands to the computer, there is still another means – brittle but efficient: powerful commands knows the command line or command prompt.
this special mode you can call out from Windows of several types:
opens a small plain window, that you are with a short message and an output like “C:usershugo >” welcomes. The latter is your private directory on this system and referred to the current directory. If you enter a command so, then he refers without further naming of a directory on the current folder.
If you now enter a system command such as “ping” or enter “ipconfig”, then get a text output which can study in peace. Would enable such commands directly from Windows via start – run , the output would be away visible and then again only fractions of a second in a window because Windows automatically closes the now useless window.
the command line version for to be more efficient and usually the advantage. An example: You want to delete everything in a particular directory, can start the Windows Explorer, control the desired directory, mark all files and initiate the deletion via the context menu. With the command line a command, such as
it does, however, del c:tmp
DOS veterans know him, the handle to the key [F3] . And this trick still works to get the command used last in the command prompt again in the input line. In later versions of Windows, it is you with the [Pfeil oben] -button. This works also for other operating systems, such as Linux or it is even better on the command line of Mac OS x.
to display a list of recent commands. Press the button [F7] . With the cursor, you can then select a command and take in the input line.
Unfortunately the Windows command line forgets entered commands, when it is closed. But in longer sessions at the console, this history is very useful if you always need a certain command.
Two directories with the name appear in the file list the thing with the
points with every DIR command “.”and”..”. They represent nothing more than the current and if present the parent directory. Yes, it is well known that one
del. or xcopy c:. a:
same effect as you would
del *. * or xcopy c:*.* write a:
. But also the use of the two points is worth taking. You want to copy all files into the next higher directory simply xcopy command
directory changes is also working with the two points worth. You want such as c:wordtexteprivat to c:wordtextebuero
move enough cd… buero
it is worthwhile, to deal with the points.
pause screen output the key combination [Strg – S] belongs to the long-forgotten DOS functions. With her you can stop the screen output.
key, then we continue. This works with all editions of the DOS level: shown with directory content as well as with texts that type per . The same function fulfilled by the way, the [Pause] -button.
their prompt does not dispense. But it will take other users occasionally in the width of the command prompt.
If you already know the simple commands, wait soon the next hurdle: how to give a long file name, roughly, to the directory their own DateienMeine lyrics to copy?
the solution: use the directory names with spaces in quotation marks, for example:
xcopy “Eigene DateienMeine Texte * .doc” d:
(Mit dieser Anweisung kopieren Sie die Dateien aus dem genannten Verzeichnis in das aktuelle Verzeichnis auf Laufwerk d:.)
in the Windows command line, consider prompt always the full path of the currently selected directory, as well as a “>”.
far below can be in the pretty name long. He takes away space and harm the overview.
in this case, you can remove the path from the command prompt. Write this in the command line input:
then is only “>” to see.
to switch back to the path display, enter
prompt $p$ g
on the command line, use the command “cd” into a new directory. Since the introduction of long file names, which can degenerate pretty in typing. Want in the personal area of the user’s “mark”, enter
but in the newer versions of Windows, the tab key as a shortcut does work. ” Type cd us[Tab]ma[Tab]Dok[Tab][19459011soforexamplea
there are multiple directories to the entered abbreviation, so there were also Usersmaria in the above example, then press the tab key again until the desired name appears.
command prompt in the command prompt Windows make it easier for you to these function keys work with the commands:
- [F1] : the last input line repeated letter by letter.
- [F2] : asks to what letter the previously entered command will be repeated. (The given letter does not appear then).
- [F3] : the last entered command line reviewed completely.
- [F4] : asks, to which mark the last entered command should be deleted. (Works if you have obtained a previously entered command line with [F8] ).
- [F5] : history function. Returns a command line with each key press. Stops at the first-named command.
- [F6] : sent a CTRL – Z to the command window. Thus, one may conclude, for example, the entry of a file with copy con .
- [F7] : history function. Displays the last entered commands in a selection list.
- [F8] : history function. Rotates through the command line. Switches back to the first-named command on the last entered command.
- [F9] : shows an input field where you can enter the number of a command. Where is 0 for the first order.
environment variables to simplify input
Windows for a number of hidden environment variables. You can use these so as a placeholder for a specific directory.
a typical case is for example that you want to have the output of a command as a text file on the desktop, how about the issue of ipconfig / all for all active network connections.
now you could to protect[rub
ipconfig / all > C:UsershanspeterDesktopnetze.txt
instead, but use the abbreviation % HOMEPATH, which replaced the Kommanozeile with your personal user directory. [Only
you write ipconfig / all > % homepath%Desktopnetze.txt
a further advantage is that the row for all user accounts brings the right result. So invoke the command on the PC of a colleague, ends up the file on the desktop, without that you need to know what is my user name in Windows.
try it out, the best works that echo with a forward set , so echo %CD% : list of useful environment variables in Windows
- %HOMEPATH% – directory for the current user
- % WinDir % – Windows directory
- % systemdrive % – drive letter which shows Windows hard disk
- %SESSIONNAME% – on, whether logon locally (“console) or remotely (e.g.” RDP-TCP #1234″)
- % username % – current user name
- %NUMBER_OF_PROCESSORS% – number of cores in the CPU
- %COMPUTERNAME% – assigned name of the PC
- %CD% – the current directory
- % date % – the current date
- %TIME% – the current time
- %RANDOM% – is a random number between 0 and 32767
- % ERRORLEVEL % – current error level (for example, after completion of another program)
- %CMDCMDLINE% – path of the calling command line interpreter
- %PROCESSOR_ARCHITECTURE% – shows “x 86” for 32-bit systems and “AMD64” for 64 Bit-systems (also for Intel CPUs)
you can the variables simply echo command output. Find the number of cores of your CPU, for example via
here the output of the commands on a Windows 10:
The modern descendant of the command line is the PowerShell .