Command for sharing same folder with multiple names

Asked

Viewed 156 times

4

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

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

In the command prompt there is a command for sharing (NET SHARE _shared $ = c: \ Exemplo), but only allows adding a name to the shared folder.

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

inserir a descrição da imagem aqui

1 answer

2

Your question:

In the command prompt there is a command for the share (NET SHARE _Shared $ = c: Example), but only allows adding a name for the shared folder.

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

More details on: https://technet.microsoft.com/en-us/library/bb490712.aspx

Your question:

Is there any way to do this through programming, 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 http://www.mcsesolution.com/Scripting-Batch/scripts-mais-poderoso.html

IMPORTANT:

  • Don’t forget to use the $ (hidden shared) not to display shared folders on remote computers. You will only access it knowing the shared folder name;
  • This type of sharing (Net share) is not recommended. It is very vulnerable within your network;
  • The safest procedure is to install a file server, whether for security or even centralization of all backups of the organization’s sectors and users.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.