# Archiving when destination filename is exactly the same as the source filename

**URL:** <https://discussion.mcebuddy2x.com/t/archiving-when-destination-filename-is-exactly-the-same-as-the-source-filename/94>\
**Category:** General Support / Questions\
**Tags:** commonissues\
**Created:** [June 13, 2017, 1:21am UTC](https://discussion.mcebuddy2x.com/t/archiving-when-destination-filename-is-exactly-the-same-as-the-source-filename/94 "2017-06-13T01:21:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RBoy](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@RBoy](https://discussion.mcebuddy2x.com/u/RBoy)\
**Post date:** [June 13, 2017, 1:21am UTC](https://discussion.mcebuddy2x.com/t/archiving-when-destination-filename-is-exactly-the-same-as-the-source-filename/94/1 "2017-06-13T01:21:15Z")

</div>

When you’ve configured your conversion task to write back to the original location with the exact same original filename, MCEBuddy won’t be able to archive the original file, instead it will end up overwriting it.

This is an architectural limitation of MCEBuddy because the way it works it that the conversion task has to finish before the archiving task starts. However in this case since the conversion task is overwriting the original file (same filename), by the time the archiving task starts the original file already overwritten and there is nothing to archive.

The workaround for this limitation is to write a custom command that saves the original file _before_ the conversation task finishes there by preserving the original file. In essence it’s doing the the job of the archiving task but through a custom command while the conversion task is still running.

**Add this custom command to your profile:**

```auto
CustomCommandPath="c:\windows\system32\cmd.exe"
CustomCommandParameters="/c move /y "%sourcefile%" "D:\YYY\%originalfilename%-Backup.%originalext%""
CustomCommandHangPeriod=0
CustomCommandCritical=true
CustomCommandUISession=false
CustomCommandShowWindow=false

```

**_This will copy the original file and place it in the folder `D:\YYY` and will name the file `<filename>-Backup.<extension>` before the conversion task finishes and replaces the original file with the converted file._**

You can change the destination folder and change the filename structure to suit your needs.

@ImCoKeMaN picking up on your last comment on the previous discussion forum, this cannot be done through the GUI because it’s a hard limitation on the architecture but you can include these lines into your profile (you can use a custom profiles.conf file and point MCEBuddy to it so you don’t lose it after an upgrade)

---

<div class="post-metadata">

**Author:** ![RBoy](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@RBoy](https://discussion.mcebuddy2x.com/u/RBoy)\
**Post date:** [June 13, 2017, 1:21am UTC](https://discussion.mcebuddy2x.com/t/archiving-when-destination-filename-is-exactly-the-same-as-the-source-filename/94/2 "2017-06-13T01:21:31Z")

</div>



---

<div class="post-metadata">

**Author:** ![RBoy](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@RBoy](https://discussion.mcebuddy2x.com/u/RBoy)\
**Post date:** [June 13, 2017, 1:22am UTC](https://discussion.mcebuddy2x.com/t/archiving-when-destination-filename-is-exactly-the-same-as-the-source-filename/94/3 "2017-06-13T01:22:14Z")

</div>



---

<div class="post-metadata">

**Author:** ![RBoy](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/r/2bfe46/32.png) [@RBoy](https://discussion.mcebuddy2x.com/u/RBoy)\
**Post date:** [June 13, 2017, 4:46pm UTC](https://discussion.mcebuddy2x.com/t/archiving-when-destination-filename-is-exactly-the-same-as-the-source-filename/94/4 "2017-06-13T16:46:34Z")

</div>


