Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm on Windows Vista and want to create a text file. MS DOS does not recognize edit command. What can I use instead, Windows PowerShell? Can I use notepad?

share|improve this question
Are you trying to make a text file from the terminal? You could always just run notepad.exe or something like that. – n0pe Apr 15 '11 at 5:27

To create a text file at the DOS prompt you can use this command:

  • copy con my_text_file.txt

The word "con" means [to Windows in this case] to use your keyboard as the source.

The next line will just be a blinking cursor that waits for you to type. You can type as much as you like and every Enter keystroke will also be recorded exactly. When you are finished, press CTRL-Z followed by the Enter key.

Alternatively, to initiation creating or editing a text file from the DOS prompt, you can use this command:

  • notepad my_text_file.txt

This will cause Windows Notepad to start editing the file you specified (creating a new one when you save if the file doesn't already exist).

share|improve this answer

Randolf's answer looks good.

One other suggestion. If you are used to *nix environments and want similar functionality out of your CMD you can use plain old Vim:

there is a Windows port here. One of the options when you install from the Self-installing executable is to create .bat files for command line use. This will install vim.bat to your C:\Windows folder. You can then type vim into your command line and a very basic text interface will appear with instructions to help you get started.

Basic vim syntax:

vim <file-name>

edits or creates file of that name

  • Write = i
  • Stop writing = esc
  • Running commands like save, quit or find: type colon (":")
  • Save = w
  • Quit = q
  • Find = /text to find
  • Delete: hold shift, hold arrow keys to select, press d
  • Delete line: hit esc, then d twice. i to enter write mode again

The best bit about using vim is it's on many different Linux builds and is also available for Mac, so you can move smoothly between operating systems without too much trouble. Unlike Notepad, it also has contextual highlighting for many languages (c++, PHP, Java and more).

You could also try compiling various GNU-type (including Vim) editors under MSYS, although that's a bit more effort:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .