Command to share the same folder with multiple names

4

I am currently working on an improvement in the deployment process and I would like to automate one of the new steps.

Through Windows UI I can share the same folder on the network under several different names.

At the command prompt there is a command for the share ( NET SHARE _shared $ = c: \ Exemplo ), but only allows you to add a name to the shared folder.

Is there any way to do this programmatically, such as with the Windows API or even WMI?

    
asked by anonymous 28.07.2015 / 20:43

1 answer

2

Your question:

  

At the command prompt there is a command for the share (NET SHARE _shared $ = c: \ Example), but only allows you to add a name to the shared folder.

You will need to add the [Net share] command as many times as necessary for each shared folder.

More details at: link

Your question:

  

Is there any way to do this programmatically, such as with the Windows API or even WMI?

You can use a * .bat file or even PowerShell.

Tip: Creating scripts - starting. By Daniel Donda link

IMPORTANT:

  • Do not forget to use $ (hidden shared) to not display shared folders on remote computers. You will only access knowing the name of the shared folder;
  • This type of sharing (Net share) is not recommended. He is very vulnerable within your network;
  • The safest procedure is to install a file server, either for security or even for centralizing all backups of the organization's sectors and users.
13.09.2015 / 07:56