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.
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
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.
Summary: Is there anyway to do a batch file rename function to remove the first three characters of the file name? The files have two numbers followed by Alt+0149 Example: 02•filename.seq I'd like them to j...
Summary: I have a simple dos batch file. I want to make an icon that user can click on have this dos command run without opening a dox box. nidr *.* and then I want this ourpur to a file >test.txt. I just do n...
Summary: Every times I open MS-DOS Batch File, it will closed automatically at the beginning. I had tried change the compatibility but it still same Any suggestion? ...