Die Befehlszeile funktioniert wie ein einzeiliges Textverarbeitungsprogramm, so dass Sie jeden Teil des Befehls jederzeit bearbeiten können, bevor Sie die Eingabetastedrücken , um ihn auszuführen (oder Esc, um ihn zu löschen).
Die eingegebene Befehlszeile (vor der Alias- und Variablenexpansion) kann bis zu 65.535 Zeichen enthalten. Siehe Längenbeschränkungen für Befehlszeilen.
Während der Eingabe eines Befehls können Sie (unter anderem) die folgenden Tasten verwenden (die Wörter Strg und Umschalttaste bedeuten, dass Sie die Strg- oder Umschalttaste zusammen mit der anderen genannten Taste drücken ). Die hier aufgeführten Tastenanschläge sind die Standardwerte; die Tasten können mit dem Dialog OPTION / Tastaturbearbeitet werden.
Cursor Movement Keys:
| Directive | Default Description |
| Left | Left Move the cursor left one character on the input line |
| Right | Right Move the cursor right one character on the input line |
| WordLeft | Ctrl-Left Move the cursor left one word |
| WordRight | Ctrl-Right Move the cursor right one word |
| BeginLine | Home Move the cursor to the start of the line |
| EndLine | End Move the cursor to the end of the line |
| ArgLeft | Alt-Shift-Left Move the cursor left to the previous argument |
| ArgRight | Alt-Shift-Right Move the cursor right to the next argument |
Insert and Delete Keys:
| Directive | Default Description |
| Ins | Ins Toggle insert / overstrike mode |
| Del | Del Delete the character at the cursor |
| Backspace | Backspace Delete the character to the left of the cursor |
| DelWordLeft | Ctrl-L Delete the word to the left of the cursor |
| DelWordRight | Ctrl-R Delete the word to the right of the cursor |
| DelArgLeft | Ctrl-Alt-L Delete the argument to the left of the cursor |
| DelArgRight | Ctrl-Alt-R Delete the argument to the right of the cursor |
| DelToBeginning | Ctrl-Home Delete from the cursor to the start of the line |
| DelToEnd | Ctrl-End Delete from the cursor to the end of the line |
| EraseLine | Esc Delete the entire line |
| Paste | Ctrl-V or Shift-Ins Paste line from clipboard |
| Ctrl-Shift-V Insert a " & " between lines of a multiline paste |
| Argument0 | Ctrl-0 Get argument 0 from previous command line |
| Argument1 | Ctrl-1 Get argument 1 from previous command line |
| Argument2 | Ctrl-2 Get argument 2 from previous command line |
| Argument3 | Ctrl-3 Get argument 3 from previous command line |
| Argument4 | Ctrl-4 Get argument 4 from previous command line |
| Argument5 | Ctrl-5 Get argument 5 from previous command line |
| Argument6 | Ctrl-6 Get argument 6 from previous command line |
| Argument7 | Ctrl-7 Get argument 7 from previous command line |
| Argument8 | Ctrl-8 Get argument 8 from previous command line |
| Argument9 | Ctrl-9 Get argument 9 from previous command line |
| Redo | Alt-Y Redo the last Undo |
| Undo | Alt-Z Undo the last edit |
| PrevArgument | Ctrl-B Recall the last argument from the previous command line |
Highlighting:
| Directive | Default Description |
| SelectFromHome | Shift-Home Mark from the beginning of the line to the cursor |
| SelectLeft | Shift-Left Add the character on the left to the selection |
| SelectRight | Shift-Right Add the character on the right to the selection |
| SelectToEnd | Shift-End Mark from the cursor to the end of the line |
| SelectWordLeft | Ctrl-Shift-Left Add the word on the left to the selection) |
| SelectWordRight | Ctrl-Shift-Right Add the word on the right to the selection |
| Copy | Ctrl-Y Copy the highlighted text to the clipboard |
| Ctrl-C Copy the highlighted text to the clipboard (if anything is highlighted); otherwise cancel the command |
Execution:
| Directive | Default Description |
| ExecLine | Enter Execute or accept a line |
| LineToEnd | Ctrl-Enter Copy the current command line to the end of the history list, then execute it |
| Ctrl-C or Ctrl-Break Cancel the command line without saving it in the history list |
Tab Completion:
| Directive | Default Description |
| NextFile | Tab or F9 Get the next matching filename during tab completion |
| AddFile | F10 Keep tab completion entry and add another |
| DirectoryCompletion | Shift-F6 Toggle between the default files + directories filename completion, and directories only |
| FileBrowse | F5 Display the Windows file browse dialog |
| FolderBrowse | Alt-F5 Display the Windows folder browse dialog |
| LFNToggle | Ctrl-A Toggle tab completion between long filename and short filename modes on LFN drives |
| OriginalFile | Alt-F9 Restore the original filename |
| PATHCompletion | Ctrl-F6 Toggle between completing files found in the local directory, and completing them in the local directory + all of the directories in PATH |
| PopFile | F7 or Ctrl-Tab Open the tab completion window |
| PrevFile | F8 or Shift-Tab Get the previous matching filename |
| RepeatFile | F12 Repeat the previous matching filename |
Command and Directory History:
| Directive | Default Description |
| HistWinOpen | PgUp Open the command history popup window |
| DirWinOpen | F6 Open the directory history popup window |
| EndHistory | Ctrl-E Display the last entry in the history list |
| LastHistory | F3 Return the last history entry |
| DelHistory | Ctrl-D Delete the current history list entry and display the previous entry |
| SaveHistory | Ctrl-K Save the command line in the command history list without executing it |
| NextHistory | Down Get the next command from the command history |
| NextDirHistory | Shift-PgDn Get the next directory from the directory history |
| PrevDirHistory | Shift-PgUp Get the previous directory from the directory history |
| PrevHistory | Up Get the previous command from the command history |
| PrintHistory | Ctrl-P Print the command history |
Miscellaneous:
| Directive | Default Description |
| Help | F1 Display the Help topic for the current command |
| HelpWord | Ctrl-F1 Display the Help topic for the word at the cursor |
| ParentDirectory | Ctrl-Shift-Up Change to the parent directory |
| AliasExpand | Ctrl-W Expand all aliases on the command line |
| VariableExpand | Ctrl-X Expand variables on the entire command line |
| VariableExpandWord | Ctrl-Shift-X Expand variables for the current word |
| CommandDialog | Alt-F2 Display the command dialog for the first argument on the command line |
| CommandEscape | Alt-255 Do not interpret the next keystroke as a command line editing key |
| Regex | Ctrl-F7 Display the regular expression analyzer dialog |
| SingleStep | Ctrl-F5 Toggle batch debugger single-stepping |
| FontMax | Ctrl-Plus Increase the console font size |
| FontMin | Ctrl-Minus Reduce the console font size |
| ConsoleHeightMax | Ctrl-Alt-Shift-Down Increase the console window height |
| ConsoleHeightMax | Ctrl-Alt-Shift-Up Decrease the console window height |
| ConsoleWidthMax | Ctrl-Alt-Shift-Right Increase the console window width |
| ConsoleWidthMin | Ctrl-Alt-Shift-Left Reduce the console window width |
| MoveConsoleDown | Alt-Win-Down Move the console window down |
| MoveConsoleUp | Alt-Win-Up Move the console window up |
| MoveConsoleLeft | Alt-Win-Left Move the console window left |
| MoveConsoleRight | Alt-Win-Right Move the console window right |
| RepeatArgument | Shift-F12 Repeat the previous command line argument |
Um Text in der Befehlszeile zu markieren, verwenden Sie die Maus oder halten Sie die Umschalttaste gedrückt und verwenden Sie eine der oben aufgeführten Tasten zur Cursorbewegung. Sie können ein komplettes Wort auswählen, indem Sie den Cursor an einer beliebigen Stelle des Wortes platzieren und mit der Maus doppelklicken. Wenn Sie einen Text in der Befehlszeile ausgewählt oder markiert haben, ersetzt jeder neue Text, den Sie eingeben, den markierten Text. Wenn Sie Bksp oder Entf drücken , während Text in der Befehlszeile markiert ist, wird der markierte Text gelöscht.
TCC schaltet die Markierung nicht aus, wenn Sie die Cursortasten links oder rechts (oder Umschalt-Links, Umschalt-Rechts, Umschalt-Strg-Links oder Umschalt-Strg-Rechts) verwenden. Die Auswahl (Markierung) über die Tastatur (Umschalt-Links / Umschalt-Rechts) ermöglicht es Ihnen also, zur Auswahl zurückzukehren (innerhalb der Auswahl oder unmittelbar davor oder danach) und die Größe mit Umschalt-Links / Umschalt-Rechts) erneut zu ändern.
Während Sie an der Eingabeaufforderung arbeiten, können Sie die Zwischenablage verwenden, um Text zwischen TCC und anderen Anwendungen kopieren (siehe Markieren und Kopieren von Text für weitere Details). Sie können auc per Drag and Drop einen Dateinamen aus einer anderen Anwendung in die Befehlszeile einfügen.
Die meisten Funktionen zur Bearbeitung der Befehlszeile sind auch verfügbar, wenn Sie zur Eingabe einer Zeile aufgefordert werden. Sie können die Befehlszeilen-Bearbeitungstasten beispielsweise verwenden, wenn Sie mit DESCRIBE zur Eingabe einer Dateibeschreibung aufgefordert werden, wenn Sie mit INPUT zur Eingabe eines Alias oder einer Batch-Datei aufgefordert werden oder wenn Sie mit LIST zur Eingabe eines Suchstrings aufgefordert werden.
Wenn Sie möchten, dass Ihre Eingaben in der Befehlszeile in einer anderen Farbe erscheinen, sehen Sie sich die Registerkarte Windows der Konfigurationsdialoge an.
TCC fordert Sie zur Eingabe von zusätzlichem Befehlszeilentext auf, wenn Sie dasEscape-Zeichen als allerletztes Zeichen einer eingegebenen Befehlszeile einfügen.(Das Standard-Escape-Zeichen ist das Caret "^".) Zum Beispiel:
echo The quick brown fox jumped over the lazy ^
More? sleeping dog. > alphabet
You can recall the previous command and substitute a string using the !str1!str2! syntax. For example, to recall the previous command and substitute str2 for str1:
echo foo
!echo!dir!
wird der Befehl "dir foo" ausgeführt.
Manchmal möchten Sie vielleicht einen der Befehlszeilen-Editiertastenbefehle in die Befehlszeile eingeben, anstatt die übliche Aktion der Taste auszuführen. Nehmen wir zum Beispiel an, Sie haben ein Programm, das in der Befehlszeile das Zeichen Strg-R benötigt. Normalerweise könnten Sie diese Tastenkombination nicht an der Eingabeaufforderung eingeben, da sie als Befehl "Wort rechts löschen" interpretiert werden würde. Um dieses Problem zu umgehen, verwenden Sie die spezielle Tastenkombination Alt-255. Sie geben Alt-255 ein, indem Sie die Alt-Taste gedrückt halten , während Sie 0255 auf dem Ziffernblock eingeben, und dann die Alt-Taste loslassen . Dies zwingt TCC dazu, den nächsten Tastendruck wörtlich zu interpretieren und ihn in die Befehlszeile einzufügen, ohne die besondere Bedeutung zu berücksichtigen, die er normalerweise für die Bearbeitung der Befehlszeile oder den Verlauf hätte. Sie können Alt-255 verwenden , um die normale Bedeutung von Tastatureingaben für die Befehlszeilenbearbeitung zu unterdrücken, selbst wenn diese mit Tastaturbelegungsdirektiven neu zugewiesen wurden , und Alt-255 selbst kann mit der Konfigurationsoption CommandEscape neu zugewiesen werden.
Alternative Tastatureingabemethode:
Die oben für Alt-255beschriebene Methode kann auch für die Eingabe anderer Zeichen verwendet werden. Sie müssen die Zifferntasten auf dem Ziffernblock verwenden, nicht die Tastenreihe am oberen Rand Ihrer Tastatur. Wenn diese Methode Alt + Tastatur in einer Unicode-Umgebung verwendet wird , TCC davon aus, dass ein dreistelliger Dezimalwert ein ASCII-Zeichen bedeutet, während ein vierstelliger Dezimalwert eine Unicode-Glyphe darstellt. Stellen Sie sicher, dass Ihre Hardware, Ihr Zeichensatz, Ihre Codepage und Ihre Schriftart die gewünschte Kombination unterstützen. Seien Sie vorsichtig mit dieser Methode, wenn Sie vorhaben, das erzeugte Zeichen in anderen Windows-Komponenten zu manipulieren . Weitere Informationen finden Sie im Abschnitt über ASCII, Key Codes und ANSI X3.64-Befehle.