Computing.Net > Forums > Disk Operating System > Renaming 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.

Renaming files

Reply to Message Icon

Name: Weijie
Date: April 21, 2003 at 17:53:58 Pacific
OS: win98
CPU/Ram: p2
Comment:

If I use xcopy and it found files of the same name, but i don't want to overwrite but automatically rename the file,is it possible?
Glad if you could help



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: April 21, 2003 at 20:50:30 Pacific
Reply:

You mean in case you're coping a file and a file with the same name exists on the destination, then the file should be renamed to another name, e.g. file.txt would become file1.txt, and if that also exists, rename to file2.txt, and so on, is that it?

You can't do that with XCOPY itself, as far as I know. But it can be achieved with a batch script. I can develop it, but I need to know how would you like the renaming process to behavior. Does the process I described (file.txt becomes file1.txt, or file2.txt, etc) sounds good?

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 2
Name: Weijie
Date: April 22, 2003 at 18:37:45 Pacific
Reply:

It sounds good but it would be better if you can append the upper directory's name to it like

dir1
dir2
dir3
file.txt

naming convention:file_dir2.txt

and i want to do the copying from dir1 the root directory which is why i am using xcopy
but i am a newbie at dos programming and not very good with manipulating files like using a loop.It will be better if you can explain your script so i can learn from you.Thanks


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Renaming files

rename files www.computing.net/answers/dos/rename-files/14038.html

batch file to rename files by date. www.computing.net/answers/dos/batch-file-to-rename-files-by-date/5517.html

HELP Renaming files with a .bat file www.computing.net/answers/dos/help-renaming-files-with-a-bat-file-/3679.html