Computer Hope

Other => Other => Topic started by: Fernando on March 25, 2004, 03:59:03 AM

Title: creating several files
Post by: Fernando on March 25, 2004, 03:59:03 AM
To create a file in msdos you type:

copy con myfile.txt +enter

and then the text and CTRL + Z.

But, how can you do in a .bat file to create several files without having to type CTRL+Z every time? Is it possible?

Thanks in advance,
Fernando
Title: Re: creating several files
Post by: Doomsday_J on March 30, 2004, 08:14:28 PM
You have to create the batchfile in the DOS editor like this:

Create you batch file, by using:

Edit myfile.bat

Inside the editor type:

edit myfile.txt



Using the Dos Editor is alot easier than using Copy Con
Is that what you mean?
Title: Re: creating several files
Post by: Computer Hope Admin on March 31, 2004, 02:10:50 AM
I think you mis-understood him doomsday, as far as we are aware there is no way to create multiple files using the copy con command and a batch file.
Title: Re: creating several files
Post by: Erifash on April 18, 2004, 12:04:43 PM
Yeah, there is! But not with copy con...

Here:

@echo off
echo (Put whatever commands you want executed here (even another echo))>>BAT1.BAT
echo (Put whatever commands you want executed here (even another echo))>>BAT1.BAT
echo (Put whatever commands you want executed here (even another echo))>>BAT1.BAT
echo (Put whatever commands you want executed here (even another echo))>>BAT2.BAT
echo (Put whatever commands you want executed here (even another echo))>>BAT2.BAT

and so on...

Or did you mean user input?

In that case, it's better to use the EDIT command.