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