Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>DOS is not dead.... yet!</p> <p>fahad</p> <p>There are a number of methods by which you can enter code in DOS (see EDIT further on down).</p> <hr> <h2>(1) You can send keystrokes directly to a file</h2> <p>You do this by redirecting output to <strong>CON</strong> (the console) to a file. The only oddity of this method is that you end the 'session' by entering a <strong>CTRL-Z</strong> when you are finished.</p> <p>It's basic, but this is how it goes.</p> <p>Firstly, suppose you want to display "Hello World" on the screen, a simple batch file containing the following two lines is all that is required:</p> <pre><code> @echo off echo Hello World </code></pre> <p>The '<strong>@echo off</strong>' is commonly found at the start of all batch files. It simply instructs the command interpretter NOT to display each command as it is being executed (or parsed).</p> <p>One more thing before we start. Throughout this answer, I will assume your program is named '<em>helloworld.bat</em>'.</p> <p>Enter the following lines one after the other pressing the ENTER key at the end of each line:</p> <pre><code> copy con helloworld.bat @echo off echo Hello World ^Z </code></pre> <p>The '<strong>^Z</strong>' is displayed when you press the <strong>CTRL-Z</strong> key combination (don't forget to press the ENTER key as well).</p> <p>When you press the <strong>ENTER</strong> key after <strong>CTRL-Z</strong>, DOS displays the familiar '<strong>1 File(s) copied</strong>' messege.</p> <p>You can now execute the batch file program by simply entering the program's name like this:</p> <pre><code> helloworld </code></pre> <p>And DOS will display the following:</p> <pre><code> Hello World </code></pre> <p>It can't get any more basic than that.</p> <hr> <h2>(2) You can use DOS' EDIT program</h2> <p>This is a DOS based IDE retained from around the mid-90's. Simply enter the following command:</p> <pre><code> edit </code></pre> <p>And <strong>EDIT</strong> will open in the same DOS window. When you close <strong>EDIT</strong>, you are returned back to DOS again.</p> <p><strong>EDIT</strong> also works with your mouse.</p> <p>Once <strong>EDIT</strong> opens, enter the following two lines of code:</p> <pre><code> @echo off echo Hello World </code></pre> <p>Then, click on [<strong>File</strong>], [<strong>Save</strong>], type: '<em>helloworld.bat</em>' in the "<strong>File Name</strong>" input field, use your mouse to change directories in the "<strong>Directories:</strong>" pane if you want to, then click [<strong>OK</strong>]. To return to DOS, click [<strong>File</strong>], [<strong>Exit</strong>].</p> <p>EDIT version 4.5 (I think) was context-sensitive and displayed code using different colours to seperate key word, different data type, symbols etc.</p> <hr> <h2>(3) Use Windows' built-in Notepad</h2> <p>This is simple. At the command prompt, enter the following command:</p> <pre><code> notepad </code></pre> <p>And Notepad will fire up. It's a simple text editor and does the job when entering small programs.</p> <hr> <h2>(4) Use Notepad++. It's FREE!!</h2> <p><strong>Notepad++</strong> is the programmer's choice. It's free, full of useful features and customisable. Find it on the net by searching for "<strong>notepad++</strong>".</p> <hr>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload