Search code examples
c#windowscmdlocalhostshared-directory

Creating a shared folder with special characters


I am writing a test that creates folders and shares on my machine in order to test a service. Now i am able to create all special characters named folders but when trying to run the command "net share {name}={path}" i get an error that the file is not found. Same with Powershell script.

When i manually click on the folder and share it, it works. Here is some of the names i am having trouble with, i hope someone is able to help me with this. Thanks.

====☠==== þpq®§štúûµvwxýÿzž... —¤÷(`[¤¤]´)÷¤—


Solution

  • I ended up ignoring those characters. After further investigation, i found out that regardless or not windows being able to create folders with these names, creating a share have more restrictions besides "/ \ : * ? " < > | " . Also if a character is non UTF-8, and it sort of "disappears" after naming a folder, it will also not be able to share it.

    Hope this helps.