How would you get a document to open in MS-DOS?

jhattoncchs
jhattoncchs used Ask the Experts™
on
Hi
How would I get a ".TXT" document to open in MS-DOS? I would appreciate your help.
Josh
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
try typing:

edit <filename>

(assuming edit is in your path)
guidway
If you are running MS-DOS with in windows and wanted to open a text file, you can type in:

notepad <file name>

This will of course open the text file in notepad.

Commented:
Please type that after booting into DOS (keeping ctrl key during bootup will show you this option "command prompt only"), or checking "restart in MSDos mode" in shutdown menu of windows, or clicking on "msdos prompt" in start menu / programs.
Please write the whole file name after edit (ex: edit example.txt).
To go up one directory type cd.. and to go to any desired directory in another, write its name after cd (ex: cd windows  if you are at c:\>, another ex: cd desktop if you are at c:\windows> and want to go to c:\windows\desktop>)
MoNsPoT
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Remember that full DOS will only recognise the 8.3 filename.

To see the filenames in a folder after navigating to it using the (change directory) "CD <foldername>" command, use the directory command so you see the contents in a bare display a page at a time "DIR /b /p". This is easier to see the filenames.

Use any of the following commands to view the file in the DOS window rather than the EDIT command which opens it for editing rather than just reading.

MORE [drive:][path]filename
Displays output one screen at a time with a prompt to see more, hence the name.

TYPE [drive:][path]filename
Displays the contents of text files but it usually flies to the end of the file and you can't read the beginning of it.

Remember that you can get DOS help on the syntax to use for any command by typing a space then /? after the command name eg. MORE /? will provide details of how to use this command.

Also, you can direct any file to another file or to a printer using the > command eg, to copy the file autoexec.bat to another folder somewhere under another filename, do this:

MD C:\MYFILES    This creates a folder for the test
MORE C:\autoexec.bat > C:\MYFILES\autoexec.txt

This copies the file as a .txt file.  Of course, the COPY command could have been used for this purpose instead:

COPY C:\autoexec.bat  C:\MYFILES\autoexec.txt

but this was just for illustrative purposes.

TYPE C:\autoexec.bat >LPT1

sometimes works to print the file to a "virtual" file recognised in DOS as the parallel printer port LPT1.

Hope this helps.






in the command prompt type "edit (filename).txt to view the file in dos. But remember dos only supports 8 character filenames so type the following from the directory you want to open the file from " dir *.txt /p "
this will show a list of all the txt files in the directory. So say your filename was msdosassistance.txt the file would be renamed msdosa~1.txt within DOS due to the support of the 8 characters only, so to open the file type edit msdosa~1 in the selected directory and you should be able to edit the file from here and save your changes to appear when you open the file in windows notepad.
Hope this helps!
If none of the above works, try edlin <filename>
Hello all,
I am eecomputings, a Moderator at Experts-Exchange and also an Expert within this topic area. This question has been open a long time and needs to be closed.  What I am going to do is allow feedback from the questioner and Experts for the next 7 days.  If the questioner has not come back to award the points, I will either delete the question, or send it to the PAQs worth zero points, or award an answer based on the info I have been given. Experts, please recommend a resolution for this question.  I will monitor this question for the next 7 days and come back and evaluate.

Questioner, please do NOT accept my comment as the answer!

Thank you
eecomputings
E-E Moderator

Commented:
considering my answer would work at a standard dos prompt I would think I should get the points. :0)
I suggest you just close this now and award guidway the 400 points.

Have you seen this???

http://www.experts-exchange.com/Operating_Systems/Win98/memberProfile.jsp?mbr=jhattoncchs

Quote: Need a hard question answered? Send me an email to jhattoncchs@aol.com or post it here on the web page.

Maybe jhattoncchs is too busy answering other "hard questions" to navigate his way back here :-)

Commented:
Hi,
I agree with the two above comments.
Sincerely,
MoNsPoT
The questioner last logged in to the site near the end of last March, and gave no feedback.  Clearly, guidway answered the question.

eecomputings
E-E moderator

Commented:
thank you. Keep up the good work! :0)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial