# Rename files in a folder?

**URL:** <https://forum.dynamobim.com/t/rename-files-in-a-folder/30564>\
**Category:** Developers\
**Tags:** python\
**Created:** [January 10, 2019, 7:57pm UTC](https://forum.dynamobim.com/t/rename-files-in-a-folder/30564 "2019-01-10T19:57:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucifer](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/lucifer/32/67268_2.png) [@lucifer](https://forum.dynamobim.com/u/lucifer)\
**Post date:** [January 10, 2019, 7:57pm UTC](https://forum.dynamobim.com/t/rename-files-in-a-folder/30564/1 "2019-01-10T19:57:46Z")

</div>

hi dynapips,

im trying to rename existing file using dynamo, but i cant get it to work. Any ideas?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/7/078b88cb91c497579b6c8e813e45392b1435c840.png)

```
import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)

import os

files = IN[0]
newNames = IN[1]

nfiles = []

for i, n in zip(files,newNames):
	newfile = os.rename(i, n)
	nfiles.append(newfile)

OUT = nfiles
```

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [January 10, 2019, 8:06pm UTC](https://forum.dynamobim.com/t/rename-files-in-a-folder/30564/2 "2019-01-10T20:06:18Z")

</div>

You have to feed it an entire path name, not just a file name. Right now you are just sending in two bits of text and it has no idea what to do with it.
