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:R...