Does anyone happen to know how to share a folder through code?

I think that there's a way through the API, but I can't figure out which command. If anyone knows of a nicer way (eg FileSystemObject or similar) please let me know

Cheers

Chris