• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Buried in cloud files? We can help with Spring cleaning!

    Whether you use Dropbox, Drive, G-Suite, OneDrive, Gmail, Slack, Notion, or all of the above, Dokkio will organize your files for you. Try Dokkio (from the makers of PBworks) for free today.

  • Dokkio (from the makers of PBworks) was #2 on Product Hunt! Check out what people are saying by clicking here.


Instructions for Using the Windows Command Prompt

Page history last edited by Alan Liu 6 years, 4 months ago

What It Is

The Windows command line prompt (or command line) allows users to enter commands in a text-only language descended from the original Microsoft "DOS." It is the equivalent of the Mac "terminal" and Unix "shell" interfaces allowing users to enter commands in versions of "bash."


Opening Windows Command Prompt

  • Method 1: In the DH Workshop folder on the desktop of the workstations for this workshop, click on the shortcut to the Windows command prompt:
  • Method 2: Search in Windows for "command prompt"


Configuring the Windows Command Prompt to for "Quick Edit"

  • The Windows command line interface is a very old interface that originally did not allow users to copy or paste except through arcane keyboard tricks. To enable the current version of the Windows command prompt to accept pasted text, do the following:
  • Locate the little icon at the top-left of the command window frame. Click on the icon to pull down a menu of options.
  • Choose "Properties" from the menu of options, and check the box for "Quick Edit". Then press "Okay" to save the option.



Elementary commands for the Windows command line:

(Remember that the separator in Windows path names is a back-slash \ ). (On Mac machines, it is a forward-slash / )

  • Navigation:
    • Change directory (folder):
      • cd [path of target directory]  --For example: "cd c:\workspace"
    • Move up one level in directory (folder) tree:
      • cd ..
    • Invoke a command in a subfolder:
      • For example: "bin\[program name]" tells the command interface to go into the "bin" subfolder and call up a command or script there.
  • See what is in a directory (folder):
    • dir  --For example, typing in "dir" followed by a return will show a list of the contents of the directory in which you are currently located.
  • Entering commands:
    • Type in a command (or copy one in) as a single text string with no returns or breaks in the line; then hit Enter (Return).
    • To re-enter a command, click the F5 function key on your computer, which will auto-type the immediately previous command text string you entered.
    • To copy in a command that you have created in a text or doc file in advance, be sure that your Windows command prompt window has been configured for "Quick Edit" (see above). Copy the text of your command form your text or doc file, then right-click in the Windows command prompt window to paste.



Best practices for working with the Windows command prompt (or any command shell):

  • Draft your command text strings in a plain-text editor (the default editor in Windows is the Notebook program) or a word processor program. (A more capable alternative to Notebook for working with plain text strings is Notepad++
  • Then copy the command text strings you create from there to the command prompt (right-click to paste into the Windows command prompt window; "quickedit" for the window must be configured). 
    • Be sure you are not including any line breaks or returns in the string. (It's best to turn "word wrap" off under the View tab in Notebook to avoid the possibility of inadvertent line breaks.)
  • The following is an example of a typical command text string for the MALLET topic modeling program, showing why it is best practice to draft and save commands in a text or word processor file rather than typing them directly into the command prompt and trying to fix errors there:



More on "How to use the Windows command line (DOS)":



Comments (0)

You don't have permission to comment on this page.