# Gateway scoped mapped drive

**URL:** <https://forum.inductiveautomation.com/t/gateway-scoped-mapped-drive/20483>\
**Category:** Ignition\
**Created:** [November 1, 2018, 3:20pm UTC](https://forum.inductiveautomation.com/t/gateway-scoped-mapped-drive/20483 "2018-11-01T15:20:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [November 1, 2018, 3:20pm UTC](https://forum.inductiveautomation.com/t/gateway-scoped-mapped-drive/20483/1 "2018-11-01T15:20:29Z")

</div>

I have a script to move files from one mapped drive to another, works fine in script console.

Running as a gateway timer script, it doesn't.

> [@Gateway Script can't open directory](http://forum.inductiveautomation.com/t/gateway-script-cant-open-directory/3003/4):
>
> It has to do with permissions. When you run the script from the client it runs under the account you are logged in as. When you run a script in the gateway it runs on the gateway and uses the local system account. That mapped drive doesn’t exist for the local system account. You can change which account the Ignition Windows service runs under by going to the Services Control Panel. It is under Control Panel \> Administrative Tools \> Services. Right click on the Ignition service and select Proper…

I've changed the Ignition service to run under my domain user account that I'm logged into the SCADA workstation as.

Looking at the post above, the 2nd part of the suggestion is to not use ":P\" but use explicit "\\computername\foldername\"

However, the machine I am writing to (archive path) is not on the domain, this is why I went for a mapped drive option so I didn't have to start worrying about passing through credentials.

Is there any way round this for a machine on the LAN but not the domain?

File "", line 6, in OSError: (2, 'No such file or directory', 'S:\')

```auto
import os, shutil
system.util.getLogger("PRT_Transfer").info("PRT transfer triggered")
inputPath = "\\\\S:\\"
archivePath = "\\\\I:\\"		
print inputPath
files = os.listdir(inputPath)
archive = os.listdir(archivePath)

if len(files) > 0:
	for file in files:
		if file not in (archive) and file.endswith('.PRT'):
			shutil.move(inputPath + file, archivePath + file)
			print "moved prt"
			system.util.getLogger("PRT_Transfer").info("moved prt")
		else:
			print "no new files to transfer"
			system.util.getLogger("PRT_Transfer").info("no new files to transfer")
else:
	print "Zero files"
	system.util.getLogger("PRT_Transfer").info("Zero files")

```

Edit: sorry when proof reading I see it's not even getting past input path. I can make that explicit as it's on domain, but my thoughts are once it's past that it's going to stop at :I\

---

<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:** [November 1, 2018, 3:23pm UTC](https://forum.inductiveautomation.com/t/gateway-scoped-mapped-drive/20483/2 "2018-11-01T15:23:58Z")

</div>

Have you followed all the instructions here? [https://docs.inductiveautomation.com/display/DOC79/Mapping+a+Network+Drive](https://docs.inductiveautomation.com/display/DOC79/Mapping+a+Network+Drive)

edit: not 100% sure it’s applicable if you can’t map a drive letter to a UNC path.

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [November 1, 2018, 3:30pm UTC](https://forum.inductiveautomation.com/t/gateway-scoped-mapped-drive/20483/3 "2018-11-01T15:30:04Z")

</div>

I have not, did not know the conf needed edited.

I’ll give that a go with:  
wrapper.ntservice.account=user  
wrapper.ntservice.password=password  
wrapper.share.1.account=the\_pc\_name\user\_acccount\_I\_created  
wrapper.share.1.password=password

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [November 2, 2018, 5:32am UTC](https://forum.inductiveautomation.com/t/gateway-scoped-mapped-drive/20483/4 "2018-11-02T05:32:36Z")

</div>

As suspected, sorting S:\ led to I:\ not recognised… however I am very pleased to report modifying the conf file worked 😃

For both user and password fields in the conf file, I created a local admin login user on the remote non-domain PC.

Thank you!
