Creating Shared Folders from the Command Line
You can create new shared folders from the command prompt using the net share command. Type net share / ? and press the Enter key at any command prompt for help with the syntax and options.
To create a shared folder, type net share name_of_share=driveletter:\path and press Enter, eg: to create a shared folder named companypayroll for the folder C:\Payroll, type net share companypayroll=c:\payroll.
To remove the share, type net share companypayroll /delete.