Help to create Script to create shares - Windows xp or SBS

I have a Windows xp pro pc connected to a Small Business Server 2003 domain.  
There are 5 usb drives connected to the XP Pro machine.
Four of the drives have shares on them.

Each time  this XP pro machine is rebooted, all the shares on the usb drives disappear. I have to manually recreate them and assign the correct permissions.  

I have searched in Experts-Exchange, I cannot find a suitable solution.

I assume some sort of script could perform this task.  I am a script novice.

1.) What commands would I enter into a script to create the share and assign permissions?

2.) What type of script should this be?  (logon script?  local script on the XP machine?  )

3.) What is the best way to invoke this script?

4.)  Perhaps someone has a script they could share?
Who is Participating?
Seth SimmonsConnect With a Mentor Sr. Systems AdministratorCommented:
from the command line, you can use net share

only problem is, the /grant option only became available in windows 7 which means in xp you can't specify share permissions.  by default it will grant everyone full control yet would be superseded by the file system permissions

if you wanted to share f:\foo then you would do net share sharename=f:\foo and just repeat for the shares on the other drives.  you could put those statements in a batch file on the desktop or your own login script.  it's simple but works to the extent xp command allows for; though might not be entirely what you need.  doing net share /? will give you the full syntax.  you could look at the links above if you want to try with powershell or vb script
Cris HannaCommented:
How big are these drives?  The real solution is to move the data onto the SBS sever or a NAS unit
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

ZabagaRConnect With a Mentor Commented:
If you use the net share command as seth2740 suggested, you can kick off that "net use" script through windows scheduled tasks. That way the script will share your folders at the start up of the XP machine. From explorer, go to c:\windows\tasks (or run scheduled tasks from the control panel).
Add a new task. Have it run the batch file that contains your "net share" statements. Choose the option to run it when the computer starts up. Then just 'next' through until you've added the task.
Larry Struckmeyer MVPCommented:
Agreeing with CrisHanna_MVP.  Data stored on external USB drives is data loss wating to happen.  And pointing out that scheduled tasks are unnecessary when you can place the net use commands in the logon script in Server /SBS 2003.  Scheduled tasks just complicates it.

But if you have important informatio on external USB drives that are not mirrored and not backed up, you will not be happy when (not if) those drives fail.
donpickAuthor Commented:
Thank you all for your help and advice.  It finally occurred to me the shares on the usb drives should not be disappearing after a reboot.  Some procedure or configuration must be wrong.  I checked the boot order on the affected pc.  The C drive was 4th in line.  Stupid me.  I made it first in line and now the problem is solved.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.