# File Path Format to Access Network Drives

**URL:** <https://forum.inductiveautomation.com/t/file-path-format-to-access-network-drives/18172>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [May 25, 2018, 3:22pm UTC](https://forum.inductiveautomation.com/t/file-path-format-to-access-network-drives/18172 "2018-05-25T15:22:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bill.diblasi](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@bill.diblasi](https://forum.inductiveautomation.com/u/bill.diblasi)\
**Post date:** [May 25, 2018, 3:22pm UTC](https://forum.inductiveautomation.com/t/file-path-format-to-access-network-drives/18172/1 "2018-05-25T15:22:12Z")

</div>

I can access a network drive successfully using the Script Console and the following formats, but not from a Gateway Event / Project script.

I got my network drive path using the Command Prompt command: `> net use`  
I got the IP Address of the server by using: `> ping SERVERNAME`

* * *

Script Console  
Input

```auto
import os
print 'Server Name References:'
print os.path.isdir('\\\SERVER\\FOLDER\\folder')
print os.path.isdir('\\\SERVER/FOLDER/folder')
print os.path.isdir(r'\\SERVER\FOLDER\folder')
print os.path.isdir(r'\\SERVER/FOLDER/folder')
print os.path.isdir('\\\\SERVER\\FOLDER\\folder')
print os.path.isdir('\\\\SERVER/FOLDER/folder')
print 'IP Adrress References:'
print os.path.isdir(r'\\\IPADDRESS\\FOLDER\\folder')
print os.path.isdir(r'\\\IPADDRESS\\FOLDER\\folder')
print os.path.isdir(r'\\\IPADDRESS/FOLDER/folder')
print os.path.isdir(r'\\IPADDRESS\FOLDER\folder')
print os.path.isdir(r'\\IPADDRESS/FOLDER/folder')
print os.path.isdir('\\\\IPADDRESS\\FOLDER\\folder')
print os.path.isdir('\\\\IPADDRESS/FOLDER/folder')

```

Output

```auto
Jython 2.5.3 (v2.5.3:3d2dbae23c52+, Nov 17 2012, 11:51:23) 
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_171

>>> 
Server Name References:
True
True
True
True
True
True
IP Adrress References:
True
True
True
True
True
True
True

```

* * *

Gateway Startup Event Script

`project.watcher`

Project Script watcher

```auto
import os
GWLog = system.util.getLogger("GatewayStartupEventLog")
GWLog.info('Server Name References:')
GWLog.info(str(os.path.isdir('\\\SERVER\\FOLDER\\folder')))
GWLog.info(str(os.path.isdir('\\\SERVER/FOLDER/folder')))
GWLog.info(str(os.path.isdir(r'\\SERVER\FOLDER\folder')))
GWLog.info(str(os.path.isdir(r'\\SERVER/FOLDER/folder')))
GWLog.info(str(os.path.isdir('\\\\SERVER\\FOLDER\\folder')))
GWLog.info(str(os.path.isdir('\\\\SERVER/FOLDER/folder')))
GWLog.info('IP Adrress References:')
GWLog.info(str(os.path.isdir(r'\\\IPADDRESS\\FOLDER\\folder')))
GWLog.info(str(os.path.isdir(r'\\\IPADDRESS\\FOLDER\\folder')))
GWLog.info(str(os.path.isdir(r'\\\IPADDRESS/FOLDER/folder')))
GWLog.info(str(os.path.isdir(r'\\IPADDRESS\FOLDER\folder')))
GWLog.info(str(os.path.isdir(r'\\IPADDRESS/FOLDER/folder')))
GWLog.info(str(os.path.isdir('\\\\IPADDRESS\\FOLDER\\folder')))
GWLog.info(str(os.path.isdir('\\\\IPADDRESS/FOLDER/folder')))

```

Gateway Logs

```auto
GatewayStartupEventLog	25May2018 10:39:23	False
GatewayStartupEventLog	25May2018 10:39:23	False
GatewayStartupEventLog	25May2018 10:39:23	False
GatewayStartupEventLog	25May2018 10:39:22	False
GatewayStartupEventLog	25May2018 10:39:22	False
GatewayStartupEventLog	25May2018 10:39:22	False
GatewayStartupEventLog	25May2018 10:39:22	False
GatewayStartupEventLog	25May2018 10:39:21	IP Adrress References:
GatewayStartupEventLog	25May2018 10:39:21	False
GatewayStartupEventLog	25May2018 10:39:21	False
GatewayStartupEventLog	25May2018 10:39:21	False
GatewayStartupEventLog	25May2018 10:39:21	False
GatewayStartupEventLog	25May2018 10:39:21	False
GatewayStartupEventLog	25May2018 10:39:21	False
GatewayStartupEventLog	25May2018 10:39:20	Server Name References:

```

I took a look at the [guide for mapping network drives](https://docs.inductiveautomation.com/display/DOC79/Mapping+a+Network+Drive) but I don’t have the permissions for editing config files on my laptop. I am designing in a local test environment.

---

<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:** [May 25, 2018, 3:37pm UTC](https://forum.inductiveautomation.com/t/file-path-format-to-access-network-drives/18172/2 "2018-05-25T15:37:46Z")

</div>

You need to follow the guide in order for gateway-scoped scripts to be able to access network drives.

When you run the script in the playground (designer scope), the Designer process belongs to your user and the drives are accessed as your user.

When you run it in the gateway scope, the process is the Ignition Gateway, running as a service under the service account, and the permissions will be different.
