Computing.Net > Forums > Windows XP > Dos batch file rename: question.

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.

Dos batch file rename: question.

Reply to Message Icon

Name: mholden58
Date: June 14, 2005 at 07:22:20 Pacific
OS: windows xp
CPU/Ram: intel centrino
Comment:

Hi I wonder if someone can help.
I use a batch file to process some files at work. problem is the batch file has to use fixed file names. Is there a way to save the original file name, rename to the filename the batch file uses, take the processed file (which has a new name) and then rename the processed file to the original name (plus a suffix on the filename ideally)
Any help appreciated.
Martin



Sponsored Link
Ads by Google

Response Number 1
Name: rayok123
Date: June 14, 2005 at 11:57:41 Pacific
Reply:

a batch file can utilise any instruction you can type in the command line so yes you can use rename to rename a file or copy if you want to preserve the original in case of accident

You can write a pre processing batch file that renames and then a post processing one that renames it back OR you can incorporate these instructions in the original file


0

Response Number 2
Name: mholden58
Date: June 14, 2005 at 15:24:09 Pacific
Reply:

Thanks for the reply, but I could use something a little more specific.
I'll try and be more specific too, in case it helps.
Ok I have a system that produces a file, in this case a hex file.
Lets say it's called Martin01.hex.
I have to run it through a check sum cruncher batch file to actually use it.
I put the hex file into a sub directory that has the check sum cruncher batch file in it.
I have a little batch file that looks for *.hex, renames it newhex.hex. then the checksum cruncher produces a crunched version called crunched.hex.
I then run a little file that deletes newhex.hex.
The point I get stuck at is how to rename crunched.hex as martin01_cru.hex
Obviously if it always had the same name (martin01.hex) I could rename it using the very basic levels of dos skills I have (very very basic, and rather rusty I should add) But the file name I start with always varies.
I just wanted to be able to rename the new (crunched)file within the batch file I use to run the cruncher tool.
Well that's probably muddied the waters rather than clarifying it. I do appreciate the help.
Martin.
PS I did find a similar post via the search feature but it was inconclusive, and the bit of script in the reply didn't work for me.


0

Response Number 3
Name: mholden58
Date: June 16, 2005 at 12:10:23 Pacific
Reply:

Just bumping this back to page 1. I've been trying everything I can think of and still no joy.
Any help appreciated.
Martin.


0

Response Number 4
Name: mholden58
Date: June 20, 2005 at 09:57:43 Pacific
Reply:

Query kindly answered by M2 on the DOS forum.
Martin.


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 Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Dos batch file rename: question.

Batch file renaming question www.computing.net/answers/windows-xp/batch-file-renaming-question/111359.html

dos batch file silent windows xp www.computing.net/answers/windows-xp/dos-batch-file-silent-windows-xp/139313.html

Cannot Open MS-DOS Batch File www.computing.net/answers/windows-xp/cannot-open-msdos-batch-file/112694.html