English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

When writing an MS-DOS batch file, how could I get the batch to echo something, then echo something else on the same line? For example if I wanted to echo the word "Hello" followed by the contents of a file called NAME.DAT into a new file called HELLO.TXT how would I do it? (This file should then say HelloBob if the file NAME.DAT had the word Bob in it).

2006-09-16 05:57:29 · 2 answers · asked by Rich 5 in Computers & Internet Programming & Design

2 answers

I read somewhere that you have to use the CALL command to load text in from another file. Hope this is of any help. There are loads of MS DOS examples on the NET. Just google "DOS Batch File Tutorials" or something.

2006-09-16 08:02:08 · answer #1 · answered by Andrew S 2 · 0 0

I started out using DOS 5, but funnily now I would be able to solve the problem if it was using Linux's shell, rather than DOS shell.
I think that you would have to use:
@echo off, to hide the workings;
A variable set with the dat file as input;
then "echo" the "hello" and the variabe

Let me just load a shell window...

2006-09-16 13:29:09 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers