# Network File Sharing

**URL:** <https://forum.inductiveautomation.com/t/network-file-sharing/66590>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [November 16, 2022, 4:17pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590 "2022-11-16T16:17:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ILLAKKIYA\_RAJA\_DURAI](https://avatars.discourse-cdn.com/v4/letter/i/edb3f5/32.png) [@ILLAKKIYA\_RAJA\_DURAI](https://forum.inductiveautomation.com/u/ILLAKKIYA_RAJA_DURAI)\
**Post date:** [November 16, 2022, 4:17pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/1 "2022-11-16T16:17:55Z")

</div>

I am trying to establish network file share and move files from one folder to another. I updated ignition config file and able to do it in script console. But the script doesn't work in Tags value changed scripting. The goal is search a file in a file share based on tag value and move it to another folder. But when I run the script in the Tag Value Change,

disk = 'Y:'  
dirname = "Y:\Test\_Ignition\Data"  
isdir = os.path.isdir(dirname)  
system.tag.writeBlocking("[default]ALSO Testing/Status\_Directory", isdir)

the directory doesn't exit. It works well in in script console though. Need guidelines, thank you.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 16, 2022, 4:56pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/2 "2022-11-16T16:56:38Z")

</div>

You say you changed your Ignition config file, but did you stop and start your gateway afterwards? The script console will run in the client scope, so it seems your directory is accessible on your local computer.

The tag change scripts run on the gateway; therefore, your gateway still does not have that drive mapped correctly.

---

<div class="post-metadata">

**Author:** ![meredithj](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@meredithj](https://forum.inductiveautomation.com/u/meredithj)\
**Post date:** [November 16, 2022, 6:22pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/3 "2022-11-16T18:22:51Z")

</div>

The user that Ignition is running as might not have access to the file share. Try adding `os.system("net use \\\\sharepath password /USER:\\username")` before you do the os.path.isdir().

---

<div class="post-metadata">

**Author:** ![ILLAKKIYA\_RAJA\_DURAI](https://avatars.discourse-cdn.com/v4/letter/i/edb3f5/32.png) [@ILLAKKIYA\_RAJA\_DURAI](https://forum.inductiveautomation.com/u/ILLAKKIYA_RAJA_DURAI)\
**Post date:** [November 16, 2022, 6:37pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/4 "2022-11-16T18:37:34Z")

</div>

I did stop and start ignition.bat in CMD. I used the dummy credentials provided by IT department in the config file. I am looking for guideline to map the drive in the gateway. Thank you for the reply 🙂

---

<div class="post-metadata">

**Author:** ![ILLAKKIYA\_RAJA\_DURAI](https://avatars.discourse-cdn.com/v4/letter/i/edb3f5/32.png) [@ILLAKKIYA\_RAJA\_DURAI](https://forum.inductiveautomation.com/u/ILLAKKIYA_RAJA_DURAI)\
**Post date:** [November 16, 2022, 7:24pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/5 "2022-11-16T19:24:19Z")

</div>

Its working in script console with return value 2 but not in a tag. I don't know which piece I am missing here to make this happen. This drive access the key for the rest of the work.

I also tried subprocess lib, its also not working.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 16, 2022, 7:30pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/6 "2022-11-16T19:30:00Z")

</div>

If you are still getting `directory doesn't exist` error, the drive is still not mapped correctly.  
Is this drive mapped on your local computer (where your designer is running)?  
The script console will look for the `Y:` drive on your computer not the gateway computer where Ignition is hosted.

---

<div class="post-metadata">

**Author:** ![ILLAKKIYA\_RAJA\_DURAI](https://avatars.discourse-cdn.com/v4/letter/i/edb3f5/32.png) [@ILLAKKIYA\_RAJA\_DURAI](https://forum.inductiveautomation.com/u/ILLAKKIYA_RAJA_DURAI)\
**Post date:** [November 16, 2022, 7:35pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/7 "2022-11-16T19:35:17Z")

</div>

> [@dkhayes117](#):
>
> Is this drive mapped on your local computer (where your designer is running)?

Yes its mapped on local drive as Y://

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 16, 2022, 7:37pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/8 "2022-11-16T19:37:10Z")

</div>

Thats why it works in the script console.  
Your problem is it isn't mapped correctly with the Ignition service.  
What does your Ignition config look like for the mapped drive part?

---

<div class="post-metadata">

**Author:** ![ILLAKKIYA\_RAJA\_DURAI](https://avatars.discourse-cdn.com/v4/letter/i/edb3f5/32.png) [@ILLAKKIYA\_RAJA\_DURAI](https://forum.inductiveautomation.com/u/ILLAKKIYA_RAJA_DURAI)\
**Post date:** [November 16, 2022, 8:02pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/9 "2022-11-16T20:02:48Z")

</div>

> [@dkhayes117](#):
>
> What does your Ignition config look like for the mapped drive part?

wrapper.share.1.location=\fs-01\Engineering\Test\_Ignition  
wrapper.share.1.target=Y:  
wrapper.share.1.type=DISK  
wrapper.ntservice.account=daniel  
wrapper.ntservice.password=pass123!  
wrapper.share.1.account=daniel  
wrapper.share.1.password=pass123!

wrapper.share.1.shutdown.unmap=TRUE  
wrapper.share.1.startup.max\_retries=2  
wrapper.share.1.startup.retry\_interval=10  
wrapper.share.1.startup.failure=SHUTDOWN

In my laptop, the drive is mapped as Y and I tried assigning W for the target. Wrapper log info its mapped as W:

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 16, 2022, 8:12pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/10 "2022-11-16T20:12:33Z")

</div>

You have your share location as `wrapper.share.1.location=\fs-01\Engineering\Test_Ignition`  
then you are using `Y:\Test_Ignition\Data`. Wouldn't that mean you are trying to access `\fs-01\Engineering\Test_Ignition\Test_Ignition\Data` which is not the correct path.

---

<div class="post-metadata">

**Author:** ![ILLAKKIYA\_RAJA\_DURAI](https://avatars.discourse-cdn.com/v4/letter/i/edb3f5/32.png) [@ILLAKKIYA\_RAJA\_DURAI](https://forum.inductiveautomation.com/u/ILLAKKIYA_RAJA_DURAI)\
**Post date:** [November 16, 2022, 9:26pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/11 "2022-11-16T21:26:52Z")

</div>

> [@dkhayes117](#):
>
> Wouldn't that mean you are trying to access `\fs-01\Engineering\Test_Ignition\Test_Ignition\Data` which is not the correct path.

Thank you dkhayes117, I did the changes and it worked. I was confused with script console and gateway call while editing config. I am a newbie to both Ignition and python with base of PLC. Thank you so much 🙂

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 16, 2022, 9:29pm UTC](https://forum.inductiveautomation.com/t/network-file-sharing/66590/12 "2022-11-16T21:29:15Z")

</div>

Great, glad it's working! Don't worry about being new to Ignition, we've all been there 🙂
