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?
To create a text file at the DOS prompt you can use this command:
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:
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).
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
Basic vim syntax:
edits or creates file of that name
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: