Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to .... DOS batch file? 1

Status
Not open for further replies.

robWhitz

MIS
Oct 23, 2001
23
0
0
SG
I need to write a simple batch program to rename some files, based on system date. Can someone provide me some useful links where I make reference to?

Appreciate it lotz. :)
 
Thanks for the link. I manage to search the info that I wanted. :p However, the next step I need to do is to make multiple copies of a file.

For example:
I have a original template file (e.g. template.txt). I want to copy that file out to 10 other files (e.g myfile01.txt, myfile02.txt .... myfile10.txt). How can I make use of batch to 'loop' it?

Thanks in advance.
 
FOR %%a in (01 02 03 04 05 06 07 08 09 10) DO copy x.txt x%%a.txt
 
Also
If you need help setting this up as a batch file let me know
 
Hi mscallisto,
I managed to use the code that you provided, but I do not understand why ut'x '0 file(s) copied'. The variables are changed correctly.

Please help. Thanks
 
Found out the problem. It was coz I created an empty text file, which is not acceptable by the system. As soon I insert some dummy data, the code works. Thanks, mscallisto. You have been a great help. :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top