+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
Windows Thread, Bult create folders within Folders in Technical; Is this a one off task? Can't you use something like this (vbs): Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = ...
  1. #16
    SteveLaw's Avatar
    Join Date
    Jul 2008
    Location
    North East
    Posts
    91
    Thank Post
    17
    Thanked 4 Times in 4 Posts
    Rep Power
    13
    Is this a one off task? Can't you use something like this (vbs):

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder("q:\common\q:\common\STUDENT RECORDS\A-D\")
    Set colSubfolders = objFolder.Subfolders

    For Each objSubfolder in colSubfolders
    ' Do the thing
    Next

  2. #17
    ceebster's Avatar
    Join Date
    May 2009
    Location
    The World
    Posts
    104
    Thank Post
    5
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by danrhodes View Post
    just put it into the excel sheet attached the script you need will be at the far right, copy and paste that into notepad and you have your script.

    D
    How do i set permissions then for a partucluar group and no one else?

    I think the folders get permissions fromt he top



    Chris

  3. #18
    danrhodes's Avatar
    Join Date
    Sep 2008
    Location
    Wath Upon Dearne
    Posts
    1,513
    Thank Post
    157
    Thanked 181 Times in 150 Posts
    Rep Power
    68
    Quote Originally Posted by ceebster View Post
    How do i set permissions then for a partucluar group and no one else?

    I think the folders get permissions fromt he top


    Chris

    Use CACLS to set permissions from a script.

    CACLS q:\common\q:\common\STUDENT RECORDS\A-D\Foldername /E /T /C /G "GroupName":F

    Quick and easy.

    VBS is always good too Steve :-) although can be confusing for people at Chris's current level of scripting.

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder("q:\common\q:\common\STUDENT RECORDS\A-D\")
    Set colSubfolders = objFolder.Subfolders

    For Each objSubfolder in colSubfolders
    ' Do the thing
    Next
    D

  4. #19
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    42
    I think the script will look something like this:

    Code:
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder("q:\common\STUDENT RECORDS\A-D\")
    Set colSubfolders = objFolder.Subfolders
    
    Set WshShell = CreateObject("wscript.shell")
    
    For Each objSubfolder In colSubfolders
    	Set objNewFolder = objFSO.CreateFolder(objSubfolder.path & "\ECM")
    	WshShell.run "xcacls " & chr(34) & objNewfolder.path & chr(34) &  "/T /C /P "  & chr(34) & "domain\security group"  & chr(34) & ":F /y"
    	Set objNewFolder = Nothing
    Next
    You should test it on a temporary folder first and you will need to ensure that xcacls is available/installed i.e. in system32.

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Allow users create folders and shortcuts
    By RoboticGimp in forum Network and Classroom Management
    Replies: 3
    Last Post: 12th November 2009, 10:12 AM
  2. Create Bulk users and Folders
    By DanW in forum Scripts
    Replies: 14
    Last Post: 20th September 2009, 03:08 PM
  3. VB Script to create folders
    By markesmith in forum Scripts
    Replies: 2
    Last Post: 26th April 2007, 03:03 PM
  4. Replies: 0
    Last Post: 17th February 2007, 04:43 PM
  5. Script to Create My Documents Subject Folders
    By SwedishChef in forum Scripts
    Replies: 15
    Last Post: 5th July 2006, 08:14 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •