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?
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?
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.
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
Summary: Does anyone know how I could print from a DOS app. to a file in Windows 95? I tried setting Print To The Following Port in the Windows 95 printer properties to FILE, but that does not work. The prog...
Summary: Character ">" directed to a file I want to do somthing like this in a batch-file to make a new: BATCH.BAT echo copy file.txt file2.txt >nul >newbatch.bat How can I do that? The result in newbatch.bat ...