Share Folders/External Drives with CMD

share

Yesterday we had a problem regarding sharing. We needed to share an encrypted drive to be accessed from other computers. To share a folder or any drive, you would normally

  • go to the folder/drive to be shared
  • right click
  • select properties
  • select the “Sharing” tab
  • Click “Advanced Sharing”
  • Check Share this folder
  • Click the “Permissions” button
  • Change Permissions as needed

But we had a problem. Encrypted drives or any other External Drives, when removed or a user logs off the system, the sharing properties and any others are lost and defaults are loaded again. So we didn’t want that the user would have to go through all the previous steps to share a drive or folder.

So this is the solution we found!

Create a new text file and enter the following code:

NET SHARE MyShare=C: /GRANT:Everyone,FULL

Save the text file on your desktop and rename to Share.bat. Now double click the Share.bat file and your drive/folder is now shared.

What this does is that the C: drive is going to be shared with the name MyShare and Everyone is going to have Full permissions. If you want to share a folder in the C: drive and allow only one User (ex. Joe) to just have read access you would do something like this:

NET SHARE MyFolderShare=C:/Folder /GRANT:Joe,READ

Hope you found this useful. Happy Sharing!

>> More info on NET SHARE can be found here or here.

Categories

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *