PDA

View Full Version : Copy Files Option with Rename?


DougFarmer123
07-11-2006, 05:31 PM
Another DOS command I am trying to replace is a COPY command. However, this copy command also renames the file as it copies. For example, I have a basic configuation file I want to copy as the current configuration file. The DOS command would be
%DOSCMD% copy "%PROJDIR%\BaseConfig.CFG","%DELPHIDIR%\BIN\DCC32.CFG"

I cannot see how to do this in a single step. It seems I need to do a copy then a rename.

BTW - I am just now updating 4 year old Build scripts to use the new 6.1 features. They are very nice. Lots of steps that were missing in the past are making the scripts more readable and easier to maintain. Thumbs up for a great job over the years.

Doug

DougFarmer123
07-11-2006, 05:32 PM
One more comment. The above command can be done with a copy and rename step, but I also have items where the copy / rename needs to be done in the same directory. Then I seem to be foreced to use the DOS command, otherwise I end up renaming the original item.

kinook
07-12-2006, 06:47 AM
You would need to do it in two steps (copy, then rename). Within the same directory, you should only need to rename, or perhaps I'm not understanding exactly what you mean.

DougFarmer123
07-12-2006, 07:07 AM
SayI have a file named BASE.INI. I want to copy it to a file named CURRENT.INI in the same directory, but I want to save the file BASE.INI so I can do the copy again in the next run of the build script. So, for a time, I need to have both the BASE.INI and CURRENT.INI files present in the same directory.

kinook
07-12-2006, 10:35 AM
You'll probably just want to stick with %DOSCMD% for that (at least for copying).