Sponsors

Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

January 15, 2011

Create Windows shares from command line using RMTSHARE.EXE

Today i've needed a way to automatically create a windows share on flash disks with a script file (so this script can be run by the user after he pluggin the stick in).

The Windows Ressource Kit provides the tool "RMTSHARE.EXE" which is able to solve this problem. You can find the Windows Resource Kit on your Windows Server 2003/2008 CD or download it directly here.

Example:
To create a share called "temp" on folder "C:\temp" with Read/Write Permissions and grant local user "admin" type:

rmtshare \\localhost\temp=C:\temp /GRANT localhost\admin:RC