Shares multiple folders through a script

Discussion in 'Windows Server Systems' started by jonny813, Aug 13, 2008.

  1. jonny813

    jonny813 OSNN Addict

    Messages:
    88
    Hey, can anyone give any help in as to how to create a script that will share all folders within a given folder. An example of what I mean would be say in a school where each student has a home folder under their year group, how could I share all these folders individually without having to do soo manually.
    I need the script to create a hidden share using the folder name as the share name
    Set the share permissions to allow everyone full control
    And perhaps disable caching of the folder and its contents

    Any help on this would be greatly appreciated.
     
  2. ZeroHour

    ZeroHour ho3 ho3 ho3

    Messages:
    1,118
    Location:
    Scotland
  3. jonny813

    jonny813 OSNN Addict

    Messages:
    88
  4. ZeroHour

    ZeroHour ho3 ho3 ho3

    Messages:
    1,118
    Location:
    Scotland
    LOL sorry did not realise. At least others will find the solution too ;)
     
  5. fitz

    fitz Just Floating Along Staff Member Political User Folding Team

    Messages:
    4,076
    Location:
    Chicagoland
    hmm.. how did I miss this thread before - usually the scripting threads catch my eye..

    But I would have suggested both the vbs script approach and/or the dos batch approach myself. You could also look at using the rmtshare utility found in the old NT4 resource kit with the batch file approach. It is a little more versitle than "net share" in that you could use it to create the shares remotely.