Computing.Net > Forums > Disk Operating System > How do I write directly to a file in DOS?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How do I write directly to a file in DOS?

Reply to Message Icon

Name: Shane
Date: March 7, 2000 at 07:38:10 Pacific
Comment:

I want to write directly to a file from the command line in DOS. Is there a command in DOS to do that?



Sponsored Link
Ads by Google

Response Number 1
Name: Henry
Date: March 7, 2000 at 09:21:57 Pacific
Reply:

All you have to do is redirect the output from the screen to a file.
">" will redirect and create a file.
">>" will append to an existing file.
example:
dir >
dir > dirlist
dir >> dirlist


0

Response Number 2
Name: Igor M
Date: March 7, 2000 at 09:58:49 Pacific
Reply:

Hi,

You can use also COPY command to copy console input to a file. For example to create file File.txt use the command:

Copy Con File.txt

then enter needed text and to complete the job enter EOF (End-Of-File) symbol with Ctrl+Z combination (or just press F6 key which do the same).

Good luck, Igor


0

Response Number 3
Name: Owen Prince
Date: March 7, 2000 at 18:51:20 Pacific
Reply:

I am not sure what it is you are trying to do but if you want to access a file like autoexec.bat you can use the dos edit command. just type edit autoexec.bat and it will let you write in that file. just type the name of the file you want instead of autoexec.bat - don't forget the three letter tag after the dot.

Owen Prince


0

Response Number 4
Name: Knowledge Keeper
Date: March 14, 2000 at 07:15:01 Pacific
Reply:

You can "copy con file.txt" or "echo text > file.txt" or "type file.txt > file1.txt" or "echo text >> file.txt" or "type file.txt >> file1.txt". The latter appends the text to the end of file.txt. The first one sends a string of text to the file. The second one overwrites the file with the contents of another file. And finally the third one just appends the 'text' to the end of the file. Hope that helps some.


0

Response Number 5
Name: Mark McCullough
Date: March 20, 2000 at 15:13:42 Pacific
Reply:

please show me how write command in dos,
like format hardrive and, making a bootdisk


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: How do I write directly to a file in DOS?

Printing From A DOS App. To A File www.computing.net/answers/dos/printing-from-a-dos-app-to-a-file/1730.html

Character ">" directed to a file www.computing.net/answers/dos/character-directed-to-a-file/3873.html

dos print to a file www.computing.net/answers/dos/dos-print-to-a-file/1263.html