Working with the Windows Command Prompt: Difference between revisions
Hendricks266 (talk | contribs) add PATH section |
Hendricks266 (talk | contribs) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
There is a convenient way to open command prompt windows by right-clicking on any folder and selecting the relevant menu choice. | There is a convenient way to open command prompt windows by right-clicking on any folder and selecting the relevant menu choice. | ||
===Windows Vista, 7, | ===Windows 10=== | ||
Windows 10 hides the command prompt option by default and requires registry edits to reenable it. Instead, try the following. | |||
From a Windows Explorer instance open to a specific folder, click on the empty space in the path dialog bar above the file and tree view panes. This should result in the breadcrumb buttons being replaced by a text dialog containing the current path as a text string. It should be fully highlighted at this point, so simply type <code>cmd</code> to replace the existing text, then hit Enter. A command prompt window will open in the current folder. | |||
===Windows Vista, 7, 8, 8.1=== | |||
Hold '''Shift''' when you right-click on a folder and the option to open a command prompt window will appear. | Hold '''Shift''' when you right-click on a folder and the option to open a command prompt window will appear. | ||
Line 10: | Line 16: | ||
This registry patch will add a right-click option: [[File:cmdhere.zip]] | This registry patch will add a right-click option: [[File:cmdhere.zip]] | ||
==Expand the Screen Buffer== | |||
# Open a command prompt. | |||
# Right-click on the title bar. | |||
# Select '''Properties'''. | |||
# Navigate to the '''Layout''' tab. | |||
# Increase the Screen Buffer dimensions as desired. | |||
[[File:Win7 cmd Layout.png]] | |||
==How to Copy and Paste Text== | ==How to Copy and Paste Text== | ||
Line 26: | Line 42: | ||
## If you are presented with an option, select '''Save Properties for future windows with same title''' if you want to keep this change forever, or select '''Apply Properties for current window only''' if you only want to enable QuickEdit for this session. | ## If you are presented with an option, select '''Save Properties for future windows with same title''' if you want to keep this change forever, or select '''Apply Properties for current window only''' if you only want to enable QuickEdit for this session. | ||
## Click '''OK'''. | ## Click '''OK'''. | ||
[[File:Win7 cmd Options.png]] | |||
Once you have QuickEdit Mode enabled, the process is simple: | Once you have QuickEdit Mode enabled, the process is simple: | ||
Line 49: | Line 67: | ||
[[File:Win7 System Properties.png]] [[File:Win7 Environment Variables.png]] | [[File:Win7 System Properties.png]] [[File:Win7 Environment Variables.png]] | ||
From there you can edit the variable named Path (either system-wide, or limited to your user account). It is formatted as a semicolon-delimited string of text. For example, <code>C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\</code>, etc. The closer a path to the | From there you can edit the variable named Path (either system-wide, or limited to your user account). It is formatted as a semicolon-delimited string of text. For example, <code>C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\</code>, etc. The closer a path to the start of the list, the higher its precedence. | ||
=== Temporary === | === Temporary === | ||
Line 55: | Line 73: | ||
If you would like to adjust the PATH of just the current command prompt window, you can run this command: | If you would like to adjust the PATH of just the current command prompt window, you can run this command: | ||
set PATH= | set PATH=C:\Path\To\Folder;%PATH% | ||
If you find yourself often making the same temporary PATH changes, you may want to save their command invocations in a batch file that is itself located within persistent PATH. | If you find yourself often making the same temporary PATH changes, you may want to save their command invocations in a batch file that is itself located within persistent PATH. |
Latest revision as of 17:09, 31 January 2020
Opening A Command Prompt Window
There is a convenient way to open command prompt windows by right-clicking on any folder and selecting the relevant menu choice.
Windows 10
Windows 10 hides the command prompt option by default and requires registry edits to reenable it. Instead, try the following.
From a Windows Explorer instance open to a specific folder, click on the empty space in the path dialog bar above the file and tree view panes. This should result in the breadcrumb buttons being replaced by a text dialog containing the current path as a text string. It should be fully highlighted at this point, so simply type cmd
to replace the existing text, then hit Enter. A command prompt window will open in the current folder.
Windows Vista, 7, 8, 8.1
Hold Shift when you right-click on a folder and the option to open a command prompt window will appear.
Windows XP and lower
This registry patch will add a right-click option: File:Cmdhere.zip
Expand the Screen Buffer
- Open a command prompt.
- Right-click on the title bar.
- Select Properties.
- Navigate to the Layout tab.
- Increase the Screen Buffer dimensions as desired.
How to Copy and Paste Text
Source: [1]
Enabling QuickEdit Mode
To copy and paste text easily in the command prompt, first we must enable QuickEdit mode:
- Open a command prompt.
- Right-click on the title bar.
- Select Properties.
- Make sure the QuickEdit Mode checkbox is checked.
- Click OK.
- If you are presented with an option, select Save Properties for future windows with same title if you want to keep this change forever, or select Apply Properties for current window only if you only want to enable QuickEdit for this session.
- Click OK.
Once you have QuickEdit Mode enabled, the process is simple:
Copying
- Click and drag to highlight the desired text in the console.
- Press Enter in the console to copy this text into the clipboard.
Pasting
- Copy the desired text into the clipboard at its source.
- Right-click into the console to paste the text.
Configuring PATH
PATH is an environment variable that holds a list of directories in which the command prompt will search for exe files when a command is issued. For example, C:\Windows\system32\
is part of PATH by default, which allows you to type cmd
instead of C:\Windows\System32\cmd.exe
Persistent
Open the Properties dialog of Computer or This PC (by right-clicking and selecting "Properties", or by holding ALT and double-clicking), select "Advanced system settings" in the top-left, and navigate to the Advanced tab. Alternatively, press [WinKey]+[R] and issue the command control sysdm.cpl,,3
. Once on the Advanced tab, press the Environment Variables... button.
From there you can edit the variable named Path (either system-wide, or limited to your user account). It is formatted as a semicolon-delimited string of text. For example, C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\
, etc. The closer a path to the start of the list, the higher its precedence.
Temporary
If you would like to adjust the PATH of just the current command prompt window, you can run this command:
set PATH=C:\Path\To\Folder;%PATH%
If you find yourself often making the same temporary PATH changes, you may want to save their command invocations in a batch file that is itself located within persistent PATH.