# Copy activity not renaming the file

**URL:** <https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [April 1, 2019, 6:31pm UTC](https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122 "2019-04-01T18:31:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigsky155](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@bigsky155](https://forums.toadworld.com/u/bigsky155)\
**Post date:** [April 1, 2019, 6:31pm UTC](https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122/1 "2019-04-01T18:31:49Z")

</div>

Toad Data Point version: 4.3.0.718 (32 bit)

Im trying to copy an excel file to another location. The original file name has a date suffix that will change each month so I need to be able to look for a wildcard file name and then copy it. I also want to change the name of the file once it has been copied to the new location.

I have been following the instructions found here:  
[http://dev.toadfordataanalyst.com/webhelp/Content/Automation/Use\_File\_Automation\_Activities.htm](http://dev.toadfordataanalyst.com/webhelp/Content/Automation/Use_File_Automation_Activities.htm)

I am using an asterisk to wildcard the file name in the Source File field and have given it a new name to assign to the file in the "Copy name" section.

The copy activity works fine, however the problem Im having is that it retains the original file name....it wont rename it to the new name.

There is no other file in the source folder.

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [April 1, 2019, 11:42pm UTC](https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122/2 "2019-04-01T23:42:30Z")

</div>

Let me have QA test this and see what they find.

---

<div class="post-metadata">

**Author:** ![StanislavLobodzinski](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@StanislavLobodzinski](https://forums.toadworld.com/u/StanislavLobodzinski)\
**Post date:** [April 2, 2019, 1:42pm UTC](https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122/3 "2019-04-02T13:42:49Z")

</div>

Unfortunately you cannot rename files when using wildcard in Copy File activity.  
I would suggest to create batch file and execute it using Run Program activity.

Batch file example if you want static filename:  
for %%I in (\*.xlsx) do copy %%I c:\copy\newfile.xlsx

Or combination of text and original filename:  
for %%I in (\*.xlsx) do copy %%I "c:\copy\copy of %%I"

---

<div class="post-metadata">

**Author:** ![bigsky155](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@bigsky155](https://forums.toadworld.com/u/bigsky155)\
**Post date:** [April 3, 2019, 5:39am UTC](https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122/4 "2019-04-03T05:39:56Z")

</div>

okay thanks. Please let me know what they find out.

---

<div class="post-metadata">

**Author:** ![bigsky155](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@bigsky155](https://forums.toadworld.com/u/bigsky155)\
**Post date:** [April 30, 2019, 6:58pm UTC](https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122/5 "2019-04-30T18:58:40Z")

</div>

Hi Debbie,

wondering if QA has gotten back with you on this?

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [May 1, 2019, 2:19am UTC](https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122/6 "2019-05-01T02:19:50Z")

</div>

Stanislov is my developer and he answered above. We do not support renaming files when using a wildcard. Instead says this can be done by using the Run Activity. Here you can use a copy cmd. He provides an example above.

---

<div class="post-metadata">

**Author:** ![bigsky155](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@bigsky155](https://forums.toadworld.com/u/bigsky155)\
**Post date:** [May 1, 2019, 11:03pm UTC](https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122/7 "2019-05-01T23:03:31Z")

</div>

Thanks for your response. Though that does work, the problem with using a batch file I'm finding is that it always emails me the following error:

Run\_1 Error Message: UNC paths are not supported. Defaulting to Windows directory.

I know I could turn off error messages in the settings but I dont want to do that so that Im notified if a real error occurs.

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [May 2, 2019, 7:26pm UTC](https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122/8 "2019-05-02T19:26:49Z")

</div>

Are you using a substitues drive? D:.... if you so, use the fully qualified path instead. \servername\dir\subdir and this should clear up that error.

---

<div class="post-metadata">

**Author:** ![bigsky155](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@bigsky155](https://forums.toadworld.com/u/bigsky155)\
**Post date:** [June 10, 2019, 9:52pm UTC](https://forums.toadworld.com/t/copy-activity-not-renaming-the-file/46122/9 "2019-06-10T21:52:38Z")

</div>

Yep, using a fully qualified path but still throwing same error. It would be a really nice addition if you could add an activity to simply change a file name. The import activity requires a static file name to look for when importing a file, does not look it can look for a wild carded file name.
