# How to move a file from one directory to another using ignition scripting?

**URL:** <https://forum.inductiveautomation.com/t/how-to-move-a-file-from-one-directory-to-another-using-ignition-scripting/53943>\
**Category:** Ignition\
**Created:** [December 9, 2021, 3:09pm UTC](https://forum.inductiveautomation.com/t/how-to-move-a-file-from-one-directory-to-another-using-ignition-scripting/53943 "2021-12-09T15:09:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anarula](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@anarula](https://forum.inductiveautomation.com/u/anarula)\
**Post date:** [December 9, 2021, 3:09pm UTC](https://forum.inductiveautomation.com/t/how-to-move-a-file-from-one-directory-to-another-using-ignition-scripting/53943/1 "2021-12-09T15:09:03Z")

</div>

![MicrosoftTeams-image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/b/fbe98e513c0eadd7445f399e0be3aa1b046bc27b.png)

uploaded a png file that code I have tried and what error I got that is also there.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [December 9, 2021, 3:13pm UTC](https://forum.inductiveautomation.com/t/how-to-move-a-file-from-one-directory-to-another-using-ignition-scripting/53943/2 "2021-12-09T15:13:14Z")

</div>

NOTE: It is generally better if you post your code as preformatted text use the `</>` button and then paste your code. It makes it much more friendly to read.

I would also be carful publishing real IP addresses to a public forum.

The user that the Ignition Service is running under does not have write permissions to the folder you are trying to move the file from or into.

---

<div class="post-metadata">

**Author:** ![SKA](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ska/32/29528_2.png) [@SKA](https://forum.inductiveautomation.com/u/SKA)\
**Post date:** [December 9, 2021, 3:13pm UTC](https://forum.inductiveautomation.com/t/how-to-move-a-file-from-one-directory-to-another-using-ignition-scripting/53943/3 "2021-12-09T15:13:34Z")

</div>

The error is that your script/user does not have the right permissions.

c:\Program files\ usually requires administrative privileges.

---

<div class="post-metadata">

**Author:** ![awaege1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awaege1/32/28922_2.png) [@awaege1](https://forum.inductiveautomation.com/u/awaege1)\
**Post date:** [December 9, 2021, 4:02pm UTC](https://forum.inductiveautomation.com/t/how-to-move-a-file-from-one-directory-to-another-using-ignition-scripting/53943/4 "2021-12-09T16:02:26Z")

</div>

You can also just use

```auto
os.rename(currentFilePathName, newFilePathName)

```

It essentially does the same thing as shutil.move since the act of moving a file is really just re-addressing it’s pointer value, aka, renaming it.
