Write Text File to Network Path

Simple issue, I think. Have one automation running .net 461 legacy that I can write to a network path “\\servername\share\file.txt” but another automation that tells me the path is invalid that is running .net5 or higher. What is the correct syntax for a windows file share in dotnet 5?

1 Like

Hey @jrhalstead

May be try with below options pls…

  1. Add only one slash at the beginning

  2. Or map the shared to a local drive and then try using the path


If its a network path you need to pass complete UNMAPPED path.

Hi @jrhalstead ,

Please pass the complete path from the root directory till the required location.


This is a complete network path. \servername\share. I’m not passing a relative path on the local drive but a network path

Apparently write text file in Windows compatibility (not legacy) doesn’t need to be escaped and in fact, the escaping doesn’t work for network shares. But when I browse for the network share, Studio put that path in fully escaped. So \\\\server\\share doesn’t work but \\server\share does. C:\temp\file.txt works though. Seems like that should be documented somewhere or it’s a bug

stupid escape characters. That last should show c:\\temp\\file.txt

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.