Computing.Net > Forums > Disk Operating System > Numbering New Files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Numbering New Files

Reply to Message Icon

Name: DarkGlow
Date: August 30, 2009 at 14:52:07 Pacific
OS: Windows XP
Subcategory: General
Tags: DOS, files, batch, numbering
Comment:

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.Log

And 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!



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: August 30, 2009 at 20:44:44 Pacific
Reply:

@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


0

Response Number 2
Name: DarkGlow
Date: August 31, 2009 at 04:29:46 Pacific
Reply:

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.


0

Response Number 3
Name: MWCC
Date: August 31, 2009 at 06:13:15 Pacific
Reply:

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:

http://ss64.com/nt/
http://ss64.com/nt/syntax.html


0

Response Number 4
Name: DarkGlow
Date: August 31, 2009 at 06:41:04 Pacific
Reply:

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.


0

Response Number 5
Name: MWCC
Date: August 31, 2009 at 07:11:31 Pacific
Reply:

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.


0

Related Posts

See More



Response Number 6
Name: Mechanix2Go
Date: August 31, 2009 at 08:26:31 Pacific
Reply:

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


0

Response Number 7
Name: MWCC
Date: August 31, 2009 at 09:13:45 Pacific
Reply:

M2 booting into DOS will not help him, he is utilising NT Command Prompt (CMD.EXE)


0

Response Number 8
Name: Mechanix2Go
Date: August 31, 2009 at 10:37:16 Pacific
Reply:

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


0

Response Number 9
Name: MWCC
Date: August 31, 2009 at 12:29:14 Pacific
Reply:

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.


0

Response Number 10
Name: T-R-A
Date: August 31, 2009 at 16:20:26 Pacific
Reply:

"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...


0

Response Number 11
Name: MWCC
Date: September 1, 2009 at 00:23:20 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

how delete works ? Mouse sensivity


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Numbering New Files

Count the number of files www.computing.net/answers/dos/count-the-number-of-files/13393.html

New files appearing www.computing.net/answers/dos/new-files-appearing/16207.html

Compare number in file and execute www.computing.net/answers/dos/compare-number-in-file-and-execute-/11530.html