Tutorial of various MS-DOS commands. For instructions on how to
open a DOS command prompt window, see: How to Open Command Prompt.

Note: Click here for newer version of this tutorial

Monday, June 30, 2008

DOS Commands :: notepad

DOS Commands :: notepad

Although notepad is not a part of DOS, it is a useful command that you can use from a DOS command prompt window.

notepad
This command will cause the Windows Notepad text editor program to be run. This program is the same Windows Notepad program that is accessible in Windows via: Start > Programs > Accessories > Notepad

notepad filename
This command will cause the file named filename to be opened by the Notepad text editor. For example, notepad mylist.txt would open the mylist.txt file. If the file filename does not exist, Notepad will ask you if you want to create a new file with that name.

If you want to edit a file that is in a directory other than the current directory, then use the "cd directory" command first or specify the directory name as part of the filename, such as: "notepad \mystuff\ebooks\list.txt".

7 comments:

Unknown said...

is there a way to open notepad with text inserted from command?

eg.
c:\> notepad [filename] [text that will appear in notepad]

obviously this doesnt work, but you get the idea of what i would like to do.

Thanks!

Patrick Mc said...

You can do something like the following in biterscripting. (I believe there is still free download http://www.biterscripting.com .)

echo "XXX" > file.txt

The XXX is the text that will appear in the notepad. You can even pass variables and expressions if you don't know what text should appear upfront.

farrst said...

Is there any way to open notepad in read only?
e.g. notepad [filename] -r

beau said...

is there a way to access the dos command prompt through the notpad application?

yednapaws said...

type abc.txt --to show the contents of file "abc.txt" from cmd

edit abc.txt --to add/delete/edit/modify contents of file "abc.txt" from cmd

Unknown said...

can anyone help me? i want to import or copy a file that is saved in dos to a notepad txt file...

i want to import or copy dos files to notepad txt file so it is easy for me to make an excel file.

it will save us more time...

JATIN KUMAR PATRO said...

its ok to open a file like
notepad filename. but is there any way to close it from command promt