Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello there.
I am trying to make a new file in the same folder each time i use Xcopy, so that the results will be piped into a log file.
Each time i use Xcopy i would like it to create a new log to put the results in, when it creates a new log i want it to be named up in numbers for example:
1Text.Log
2Text.Log
3Text.Log
4Text.LogAnd so on and so fourth, however i don't know how to do this or for that matter, if it is even possible but if anyone can help me out i would be most grateful!
Also, i am new to batch files and even to this forum so please forgive me if i do not understand a code of such or i have broken any of the forum rules.
Thank you in advanced!

@echo off
for %%a in (1 2 3 4) do if not exist %%atext.log type nul > %%atext.log & goto :end
:end
=====================================
If at first you don't succeed, you're about average.M2

Thank you for replying Mechanix.
This has defiantly got me further, however it when i ran the batch it created 1text.log, 2text.log, 3text.log, 4text.log all at the same time. i was hoping it would only create one new log when i use Xcopy, and it will then pipe the results into the newly created log file.
Is there anyway of doing this?
Once again thanks for your time and help Mechanix.

This forum is aimed at MS-DOS and Compatable O/Ses, XP like all Windows NT based O/Ses has NT Command Prompt.
Many similar postings in the Programming Forum, but also see:

I do apologise, as i said i am new to this forum and im not familiar with the categories, i merely noticed that other people where discussing batch related topics and assumed I was posting in the correct place.

Do not worry, but with obscure O/Ses like MS-DOS this is one of only a handful which is active,
XP is your O/S which would seem initially an obvious place to post, but then I work in IT.

I will boot in DOS and try to figure out why it's creating all the files at once.
=====================================
If at first you don't succeed, you're about average.M2

Another amazing non-DOS DOS question, I guess.
He asked for a DOS script and that's what I posted.
If he's using NT you gotta wonder why it doesn't work.
My patience with this stuff is just about gone.
=====================================
If at first you don't succeed, you're about average.M2

He clearly stated XP as did the previous question OP, maybe one should "report offensive" rather than answering ?
Do new posters get a warning? as you seem to have been here a long time..........................
Maybe the Forum Admin should state what this forum is for ie 'ms-dos 1 to 6' ??? as these are standalone versions.

"Maybe the Forum Admin should state what this forum is for ie 'ms-dos 1 to 6' ??? as these are standalone versions"
That's been discussed before, but even if someone doesn't know DOS from Command Prompt, we try to help out anyway since many members are well-versed in multiple OS's...

Why not just REPORT mis-posting, it is not like there are other MS-DOS forums, and only about 5 or 6 people respond here, whereas in XP there are many many more..
I still feel that offering a sanctuary for people who want to use MS-DOS etcetc standalone is a good idea.
At the end of the day I shall report as requested by the Forum Admin, if the question is answered and the OP goes always disappointed because he has posted in the wrong forum and gets bum info, well so be it

![]() |
how delete works ?
|
Mouse sensivity
|
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |