# Permission error Copying or Writing to a file in Fileshare remote folder

**URL:** <https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874>\
**Category:** General\
**Created:** [31 July 2019 16:59 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874 "2019-07-31T16:59:08Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![KevinPamu](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@KevinPamu](https://discourse.nodered.org/u/KevinPamu)\
**Post date:** [31 July 2019 16:59 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/1 "2019-07-31T16:59:08Z")

</div>

This could be a really simple thing I am missing,

I am trying to write to a file or copy a file to a remote file share location. I get a permission error when I try to do so. I am not sure what I should be giving permission to allow node-red to write to a shared folder. This is a windows machine.

Thanks in Advance.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [31 July 2019 17:44 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/2 "2019-07-31T17:44:52Z")

</div>

which node are you using? Have you checked the info panel / readme for the node to see if it can do what you are trying to do?

---

<div class="post-metadata">

**Author:** ![KevinPamu](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@KevinPamu](https://discourse.nodered.org/u/KevinPamu)\
**Post date:** [31 July 2019 18:31 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/3 "2019-07-31T18:31:23Z")

</div>

@ukmoose I am using the file-in node. Just to make it clear, I can use it to read and write from and into a file completely okay if it is a local file. However, I am not able to write to a file (create if does not exist) on a remote location.

I did go through the info panel. no help. I believe it has to do more with node-red having access to the shared folder location.

I have the same problem if I am using the `node-red-contrib-fs-ops` node. Do not have permissions. I am running node-red as a service on a windows machine.

Any idea what file permissions can be given to this remote sharefolder?

Thanks.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [31 July 2019 18:48 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/4 "2019-07-31T18:48:15Z")

</div>

Pretty sure that can only handle local files.  
But there are [https://flows.nodered.org/?term=smb&num\_pages=1](https://flows.nodered.org/?term=smb&num_pages=1) nodes that should allow you to do what you want

---

<div class="post-metadata">

**Author:** ![KevinPamu](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@KevinPamu](https://discourse.nodered.org/u/KevinPamu)\
**Post date:** [31 July 2019 18:51 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/5 "2019-07-31T18:51:15Z")

</div>

Will try to work with these nodes. Thank you! Will give you an update after I try this.

Thanks.

---

<div class="post-metadata">

**Author:** ![KevinPamu](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@KevinPamu](https://discourse.nodered.org/u/KevinPamu)\
**Post date:** [31 July 2019 21:22 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/6 "2019-07-31T21:22:31Z")

</div>

`node-red-contrib-smb` says I am passing the wrong a wrong parameter. Still working on understanding it.

however `node-red-contrib-filebrowser` is unable to install, gives me this log.

````auto
2019-07-31T21:21:10.609Z Install : node-red-contrib-filebrowser 0.0.25

2019-07-31T21:21:10.624Z npm.cmd install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-filebrowser@0.0.25
2019-07-31T21:21:14.653Z [err] npm 
2019-07-31T21:21:14.654Z [err] ERR! code ENOGIT
2019-07-31T21:21:14.654Z [err] npm ERR! Error while executing:
2019-07-31T21:21:14.654Z [err] npm ERR! undefined ls-remote -h -t https://github.com/SCISYS-MS/node-ftps.git
2019-07-31T21:21:14.654Z [err] npm ERR!
2019-07-31T21:21:14.654Z [err]  
2019-07-31T21:21:14.654Z [err] npm ERR!
2019-07-31T21:21:14.654Z [err] undefined
2019-07-31T21:21:14.654Z [err] npm 
2019-07-31T21:21:14.654Z [err] ERR! No git binary found in $PATH
2019-07-31T21:21:14.655Z [err] npm ERR! 
2019-07-31T21:21:14.655Z [err] npm
2019-07-31T21:21:14.655Z [err] ERR! Failed using git.
2019-07-31T21:21:14.655Z [err] npm ERR!
2019-07-31T21:21:14.655Z [err] Please check if you have git installed and in your PATH.
2019-07-31T21:21:14.675Z [err] 
2019-07-31T21:21:14.675Z [err] npm ERR! A complete log of this run can be found in:
2019-07-31T21:21:14.675Z [err] npm ERR! C:\Users\test\AppData\Roaming\npm-cache\_logs\2019-07-31T21_21_14_656Z-debug.log
2019-07-31T21:21:14.695Z rc=1```

Any idea what could be wrong?

Thanks,
Kevin.
````

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [31 July 2019 21:30 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/7 "2019-07-31T21:30:10Z")

</div>

Pretty clear error:

> Please check if you have git installed and in your PATH.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [31 July 2019 23:08 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/8 "2019-07-31T23:08:51Z")

</div>

Are both of the machine Windows ?? What version of WIndows is it ?

Craig

---

<div class="post-metadata">

**Author:** ![KevinPamu](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@KevinPamu](https://discourse.nodered.org/u/KevinPamu)\
**Post date:** [31 July 2019 23:48 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/9 "2019-07-31T23:48:12Z")

</div>

@craigcurtin Yes, both are windows machines. Windows server 2016.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [2 August 2019 06:49 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/10 "2019-08-02T06:49:33Z")

</div>

I imagine Node-Red would be inheriting the permission of the service it is running as. Based on the fact that you have not stated these machines are in a Domain i would therefore assume they are standalone servers. I have not looked at the SMB node - are you able to give it permissions ? (i.e. user credentials) for the remote machine ?

Also have you checked that filesharing is enabled on the machine that you wish to create the file on - and also what firewall is in place and if it allows connections.

An easy test of some of this is to go to the command line as an administrator and type

```auto
Net use * \\Remote Machine Name\c$ /user:administrator and provide the admin password (for the remote machine) when requested

```

If this works you then know that

1. Filesharing is enabled
2. the firewall is allowing SMB packets through on both machines

Craig

---

<div class="post-metadata">

**Author:** ![Nxito](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nxito/32/88293_2.png) [@Nxito](https://discourse.nodered.org/u/Nxito)\
**Post date:** [2 August 2019 06:55 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/11 "2019-08-02T06:55:44Z")

</div>

I had a similar problem, attached link to the solution I got :

> [@Copy a local file to a shared folder with password](https://discourse.nodered.org/t/copy-a-local-file-to-a-shared-folder-with-password/12895/11?u):
>
> I already managed to solve it. Thank you for helping me, i understand now about what was wrong The bug was that node-network was not connecting to the shared folder and the copy command of the cmd did not work. Start testing the "Net Use" command in node-red and register the shared folder there: net use \ sharedfolder / u: User password In the end if it is important to re-enter the password Then I checked with net use that node-network was connected to that folder and now the copy command …

I used the execute node to solve it

---

<div class="post-metadata">

**Author:** ![KevinPamu](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@KevinPamu](https://discourse.nodered.org/u/KevinPamu)\
**Post date:** [2 August 2019 13:26 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/12 "2019-08-02T13:26:27Z")

</div>

It is on a domain, I have checked the fileshare permissions already. I see Nxito has an interesting approach to this. I'm going to try that and give an update.

---

<div class="post-metadata">

**Author:** ![KevinPamu](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@KevinPamu](https://discourse.nodered.org/u/KevinPamu)\
**Post date:** [2 August 2019 13:28 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/13 "2019-08-02T13:28:05Z")

</div>

I went through the thread. I have the exactly the same problem, same error message. Will try the Net Use command and give you an update.

Thanks.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [2 August 2019 16:17 UTC](https://discourse.nodered.org/t/permission-error-copying-or-writing-to-a-file-in-fileshare-remote-folder/13874/14 "2019-08-02T16:17:42Z")

</div>

OK if this is on a domain then do the net use command i gave you - if that works as administrator from the command line all good.

Then once you have done that do the same command again but substitute the c$ with the actual name of the share that you have create and see if that also connects with a new drive letter and confirm you can read and write to it

Once that is done you need to delete those map drives (this is important) net use (drive letter) /d - so for example

Net use t: /d

and then try and do the same commands to access the share agan but substitute the username that is being used to start node red (how are you starting Node-red - pm2 ?? or some other manager ?)

If all of that works and you can read and write to the drive, you then need to delete the drive letter again and once again do the net use command to access this drive - but this time on the end enter

/persistent:yes - which will surive reboots

Then try it via node-red

Craig
