Jump to content
Macro Express Forums

Need to copy files, renaming also


Gerry Peters
 Share

Recommended Posts

I’m using Macro Express 3.10. I created a Macro using “File Manipulation”. At startup macro express copies 4 files in a folder to my destination folder. It works fine, but I’d prefer if it didn’t replace the file with the new one, but instead saved the new file and renamed the old file. Sometimes I need the old files also. Is there a way to do this?

Link to comment
Share on other sites

Rename the existing four files. Then copy the files.

That will work for one time, but what I'm referring to is to keep renaming them over and over, maybe with a unique date and time appended to the end of the file name. So that when I look in the folder I see copies of those files.

In the fie manipulation window I’m choosing “copy files”

 

C:\Users\gmp\AppData\Roaming\Mozilla\Firefox\Profiles\09enkubr.default-1459401572414\sessionstore-backups\*.*

 

I have this scheduled to do this every time I reboot. So in the destination folder I’m seeing 4 files copied, but if Firefox is corrupted and I reboot then it copies over the good files and replaces those with the corrupted ones. So I wish I could get it to keep the old files, renaming them each time. Can Macro Express do this?

Link to comment
Share on other sites

ME commands to keep ten generations of a file:

 

delete file1_gen10.txt

copy file1_gen9.txt file1_gen10.txt

copy file1_gen8.txt file1_gen9.txt

copy file1_gen7.txt file1_gen8.txt

copy file1_gen6.txt file1_gen7.txt

copy file1_gen5.txt file1_gen6.txt

copy file1_gen4.txt file1_gen5.txt

copy file1_gen3.txt file1_gen4.txt

copy file1_gen2.txt file1_gen3.txt

copy file1_gen1.txt file1_gen2.txt

 

copy file_base.txt file1_gen1.txt

 

Alternatively, use the rename command rather than copy.

If you reboot frequently you can extend the above with more generations. If you need to get fancier you can use variables to insert date and time as part of the file name; but probably just relying on the Windows date/time stamps would be sufficient. You could simply put the above commands (with the /Y switch) into a DOS batch file and have ME run the batch file, rather than code the individual commands into a macro. See example below.

 

post-2923-0-40312600-1459895916_thumb.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...