# Copy File(s) single file rename problem

**URL:** https://www.finalbuilder.com/forums/t/copy-file-s-single-file-rename-problem/1858
**Category:** Discussion
**Created:** [September 20, 2011, 3:07am UTC](https://www.finalbuilder.com/forums/t/copy-file-s-single-file-rename-problem/1858 "2011-09-20T03:07:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ebakkest](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/e/278dde/32.png) [@ebakkest](https://www.finalbuilder.com/forums/u/ebakkest)
#### Post date: [September 20, 2011, 3:07am UTC](https://www.finalbuilder.com/forums/t/copy-file-s-single-file-rename-problem/1858/1 "2011-09-20T03:07:30Z")

</div>

I have the source and destination parameters set as the following. According to the help file: "When copying a single file (not using wildcards), then you can use the Destination field to rename the file at the same time as copying it to another location."

However, what I&nbsp;get as a result in the backup folder is a new subdirectory named "nxServer\_SecureStdXtsAes.exe", inside which I find the nxServer.exe file.

So, the file does not get renamed while copying; I&nbsp;get a new (unexpected) directory instead. I do have the "Force directories" checkbox checked; is this an unintended interplay between the options?

Source: %NXB\_OutputDir%EXE\nxServer.exe

Destination: %BackupDirectory%\nxServer\_SecureStdXtsAes.exe

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [September 20, 2011, 4:28am UTC](https://www.finalbuilder.com/forums/t/copy-file-s-single-file-rename-problem/1858/2 "2011-09-20T04:28:25Z")

</div>

Hi   
  
 You need to disable the ‘Destination is a directory’ option for the rename operation to work correctly. Otherwise you are telling the action to create a subdirectory (with the new name intended for the file) as the destination. Disable this option and the action will rename the file correctly.   
  
 Hope this helps.   
  
 Regards,   
 Steve

---

<div class="post-metadata">

### Author: ![ebakkest](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/e/278dde/32.png) [@ebakkest](https://www.finalbuilder.com/forums/u/ebakkest)
#### Post date: [September 20, 2011, 7:07am UTC](https://www.finalbuilder.com/forums/t/copy-file-s-single-file-rename-problem/1858/3 "2011-09-20T07:07:25Z")

</div>

Even though the issue can be worked around with this, I’d say the result is not consistent.   
  
 Reason: I did have “Destination is a directory” turned on originally, but both the source and destination contained the _same_ file name (nxServer.exe). However, that did not cause any extra directory creation. I guess that is a bug (at least I can’t find that exception in the help file).

---

<div class="post-metadata">

### Author: ![stephen.ryan](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/f14d63/32.png) [@stephen.ryan](https://www.finalbuilder.com/forums/u/stephen.ryan)
#### Post date: [September 20, 2011, 7:49am UTC](https://www.finalbuilder.com/forums/t/copy-file-s-single-file-rename-problem/1858/4 "2011-09-20T07:49:17Z")

</div>

Hi   
  
 In the case where the destination directory contains a file with the same name as the file you are copying, then you can use the Existing Files options to select how existing files will be handled.   
  
 If you enable the ‘Destination is a directory’ and ‘Force Directories’ options and no directory with this name exists, it will be created. This is the intended behaviour of this action. The destination will always treated as a directory when the ‘Destination is a directory’ option is enabled.   
  
 Regards,   
 Steve

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [January 1, 2012, 9:53am UTC](https://www.finalbuilder.com/forums/t/copy-file-s-single-file-rename-problem/1858/5 "2012-01-01T09:53:13Z")

</div>

Dear,

You may use this tools to solve this problem.

&nbsp;

http://longpathtool.com/

with regards

Technext
