# Mapped drive file move script not working

**URL:** <https://forum.inductiveautomation.com/t/mapped-drive-file-move-script-not-working/21717>\
**Category:** Ignition\
**Tags:** python, scripting\
**Created:** [January 7, 2019, 5:39pm UTC](https://forum.inductiveautomation.com/t/mapped-drive-file-move-script-not-working/21717 "2019-01-07T17:39:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bluemonkey136](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@Bluemonkey136](https://forum.inductiveautomation.com/u/Bluemonkey136)\
**Post date:** [January 7, 2019, 5:39pm UTC](https://forum.inductiveautomation.com/t/mapped-drive-file-move-script-not-working/21717/1 "2019-01-07T17:39:25Z")

</div>

I am trying to use a tag change script in Ignition to move files on a mapped drive. When using local C drive the script works, but when using the mapped drive on the NAS it is no longer working.

Here is the code I am using in my tag change script:

Ignition version: 7.6.7

* * *

> import os, shutil, errno  
> import datetime as dt

> date = dt.datetime.today().strftime("%m\_%d\_%Y")  
> print(date)

> os.chdir('Z:\\testloc\dest1')  
> cwd = os.getcwd()  
> print(cwd)

> checkpath = os.path.join(cwd,date)  
> print(checkpath)

> ```
> if not os.path.exists(checkpath):
> os.mkdir(date)
> source = "Z:\\testloc\source1"
> print(source)
> names = os.listdir(source)
> print(names)
> destination = (checkpath)
> print(destination)
> 
> ```

> ```
> for name in names:
> srcname = os.path.join(source,name)
> print(srcname)
> dstname = os.path.join(destination,name)
> print(dstname)
> shutil.move(srcname,dstname)
> 
> ```

> ```
> else:
> source = "Z:\\testloc\source1"
> print(source)
> names = os.listdir(source)
> print(names)
> destination = (checkpath)
> print(destination)
> 
> ```

> ```
> for name in names:
> srcname = os.path.join(source,name)
> print(srcname)
> dstname = os.path.join(destination,name)
> print(dstname)
> shutil.move(srcname,dstname)
> 
> ```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 7, 2019, 6:32pm UTC](https://forum.inductiveautomation.com/t/mapped-drive-file-move-script-not-working/21717/2 "2019-01-07T18:32:18Z")

</div>

Try using the fully qualified share instead of the drive letter.

`//serverName/shareName/path/to/folder`

---

<div class="post-metadata">

**Author:** ![Bluemonkey136](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@Bluemonkey136](https://forum.inductiveautomation.com/u/Bluemonkey136)\
**Post date:** [January 7, 2019, 7:24pm UTC](https://forum.inductiveautomation.com/t/mapped-drive-file-move-script-not-working/21717/3 "2019-01-07T19:24:37Z")

</div>

Made the following changes and script works in Visual Studio but not in Ignition. The console is not showing me any error logs either, I’m not sure that it is the correct one. I read there were changes that needed to be made to the wrapper or configuration file for Ignition but the posts were vague as to whether they were successful or not.

```auto
import os, shutil, errno
import datetime as dt

date = dt.datetime.today().strftime("%m_%d_%Y")
print(date)

os.chdir('//EngDevNAS/testloc/dest1')
cwd = os.getcwd()
print(cwd)

checkpath = os.path.join(cwd,date)
print(checkpath)

if not os.path.exists(checkpath):
    os.mkdir(date)
    source = "//EngDevNAS/testloc/source1"
    print(source)
    names = os.listdir(source)
    print(names)
    destination = (checkpath)
    print(destination)

    for name in names:
        srcname = os.path.join(source,name)
        print(srcname)
        dstname = os.path.join(destination,name)
        print(dstname)
        shutil.move(srcname,dstname)

else:
    source = "//EngDevNAS/testloc/source1"
    print(source)
    names = os.listdir(source)
    print(names)
    destination = (checkpath)
    print(destination)

    for name in names:
        srcname = os.path.join(source,name)
        print(srcname)
        dstname = os.path.join(destination,name)
        print(dstname)
        shutil.move(srcname,dstname)

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 7, 2019, 7:30pm UTC](https://forum.inductiveautomation.com/t/mapped-drive-file-move-script-not-working/21717/4 "2019-01-07T19:30:56Z")

</div>

> [@Bluemonkey136](#):
>
> I read there were changes that needed to be made to the wrapper or configuration file for Ignition but the posts were vague as to whether they were successful or not.

They are necessary, so if you haven't done that yet start there.
