# HG changeset patch # User Oleksandr Gavenko # Date 1669567671 -7200 # Node ID d699ee7377a4f5f87777a7b9ee6f6758ecf8df59 # Parent 742921adf64c63cee836a918ed811295ab8e4eb0 Defining CMD prompt. diff -r 742921adf64c -r d699ee7377a4 cmd.rst --- a/cmd.rst Sun Nov 27 18:41:07 2022 +0200 +++ b/cmd.rst Sun Nov 27 18:47:51 2022 +0200 @@ -6,6 +6,32 @@ .. contents:: :local: +Defining prompt +=============== + +Set the environmet variable ``PROMPT``, example of ``.reg`` file:: + + [HKEY_CURRENT_USER\Environment] + "PROMPT"="cmd# " + +I embedded current time and directory; also a new line for readability of commands when a current +working directory path is too long:: + + [HKEY_CURRENT_USER\Environment] + "PROMPT"="$T$S$P$_cmd#$S" + +CMD has built-in command to modify this env var:: + + prompt "FORMAT" + +To list available options use ``prompt /?``. + +Resize a conhost window +======================= +:: + + cmd# mode CON: COLS=120 LINES=40 + Quoting. ======== @@ -79,12 +105,6 @@ $ for /f "tokens=1 delims=" %%s in (users.txt) do (echo %%S & command "%%S") >> outputfile.txt -Resize cmd window. -================== -:: - - cmd# mode CON: COLS=120 LINES=40 - Limits. =======