Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
How would i read text from a certin file, and then echo it back to dos. I know the way u can echo to dos is something like echo bla bla >> Bla.txt.
How would i read stuff from bla.txt, and echo it back into dos prompt?

If it's XP, forget DOS.
By 'echo to the prompt' do you mean 'put it on the screen'?
[Rather than in a file?]
=====================================
If at first you don't succeed, you're about average.M2

Heh i still call it dos, considering its ms-dos. But anyway. What i meant was..
Say i had a file named boobs.txt and it had jordan is god in the text file
how would i display what is in the text file (jordan is god) into the cmd.exe (ms-dos). Like it reads the text file, and what ever is there it displays on ms-dos

copy boobs.txt con > nul
=====================================
If at first you don't succeed, you're about average.M2

did not work, what i want it to do is READ BOOBS.txt. and then whatever is in the text file it displays in cmd.exe

"did not work"
Doesn't say much. What might help is to say what it DID; or what it DIDN'T DID.
=====================================
If at first you don't succeed, you're about average.M2

You're going to need to come up with a different way of explaining what you want. Based on your current description, both methods that we've given will do what you asked.

Like they both said, to display the contents of a text file to STDOUT run this command:
type boobs.txt
Make sure the file you are trying to display is in your current working directory. If it is not, you need to CD to that directory. For example, if boobs.txt is on your Desktop, do this:
Start | Run | cmd and hit Enter | cd desktop | type boobs.txt@M2,
What is con used for? In the past I've used it to create files like this:
copy con filename.txt
text
...
^zBut what other uses does it have, and what does it actually do?
Thanks,
Tony
"Computer security." — Oxymoron

Hi Tony,
con is 'the console'; stdout goes to 'the screen'.
So in your example:
copy con filename.txt
boils dowm to:
copy what I put on the screen to filename.txt
==================
similarlycopy somefile con
means put what's in somefile onto the screen.
For most purposes you don't want the '1 file copied' msg so you:
copy somefile con > nul
which redirects stdout to nul; nul is the 'bit bucket'. What goes in there never comes out. Somewhat like a black hole. But Stephen Hawking is still working on that.
==================================
As to orig post, you can TYPE or COPY without chamgimg dirs.type x:\some\other\place\somefile
HTH
=====================================
If at first you don't succeed, you're about average.M2

"As to orig post, you can TYPE or COPY without chamgimg dirs."
Yes, I know. I just figured he wasn't in the correct directory, and wasn't putting the full path.
"Computer security." — Oxymoron

I think he stopped "looking". LOL
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |