1.

Solve : help me, I'm stupid. Simple .bat files question?

Answer»

Sorry for bothering you people, but I am realy stupid, and it seems I CANT get even a VERY simple task done.
What I WANT to know is how can I put multiple command lines in a .bat file, so it may run all of them at once.
what I wanna do is something like:
go to the secific directory
copy 2 files into one.(I know how to do this in the prompt, but when it gets to the . bat file, DOS seems to run only the first line.)
Thanks,
Zare.What's the code you've got so far?

If you go to Notepad, you can create a batch file with pretty much as many lines as you want.
For example:
Code: [Select]copy "C:\documents and settings\username\desktop\file1.txt" "C:\file.txt
copy "C:\documents and settings\username\desktop\file2.txt" "C:\file.txt
Then go to File, Save As, copyfiles.batQuote from: Zarevock on June 20, 2008, 06:33:46 PM

Sorry for bothering you people, but I am realy stupid, and it seems I cant get even a VERY simple task done.
What I want to know is how can I put multiple command lines in a .bat file, so it may run all of them at once.
what I wanna do is something like:
go to the secific directory
copy 2 files into one.(I know how to do this in the prompt, but when it gets to the . bat file, DOS seems to run only the first line.)
Thanks,
Zare.
there's no stupid people, only LAZY peopleQuote from: Zarevock on June 20, 2008, 06:33:46 PM
What I want to know is how can I put multiple command lines in a .bat file, so it may run all of them at once.

You can't do that. You can put multiple commands in a batch file, so that it will run them one after the other. I expect that is what you meant?

Quote
go to the SPECIFIC directory

Code: [Select]cd /d "d:\path\to\desired\directory"
I am not sure what you mean by this:

Quote
copy 2 files into one

If you mean join two files together to form a third file, then this would do that:

Code: [Select]copy file1+file2 file3
Why don't you post the batch file that you wrote, since there may be an error in the first line that stops it ever getting to the second one.




It may be usefull to insert a "Pause" command after each line so that you can take time to read the console output and determine what's failing.
A simple spelling mistake can be found by reading the output.


Discussion

No Comment Found