scgf Posted January 21, 2007 Posted January 21, 2007 A few years ago I set up a set of empty folders in all user home areas to encourage them to file work according to subject. So each user had /My Documents/ICT, /My Documents/Science etc.. Unfortunately I have lost the script which accomplished this. I know it was something I had to type in a terminal window, but that's about it. We are using MS Server 2003/XP Workstations with Ranger. Any ideas? Cheers.
Kyle Posted January 21, 2007 Posted January 21, 2007 I have a CMD file that does just this but its at work, if no one replies tonight I'll sort it out for you tomorrow.
scgf Posted January 21, 2007 Author Posted January 21, 2007 What a quick response!! Thanks very much, Kyle.
Dos_Box Posted January 22, 2007 Posted January 22, 2007 You should have posted it at 3am, it would have been quicker!* *Bloody innsomniac members! P.S. Oh, and welcome BTW
tosca925 Posted January 22, 2007 Posted January 22, 2007 You should have posted it at 3am, it would have been quicker!* I'm nornally hovering around here till 1-00am but it does go quiet after 11-30pm. With all these new members and all these added posts it takes me ages to get through them all on a daily basis.
pooley Posted April 26, 2007 Posted April 26, 2007 Anychance of a copy of the script or cmd file ? cheers
scgf Posted April 26, 2007 Author Posted April 26, 2007 I sent a PM to Kyle back in January asking if he'd mind sending me the script, but he hasn't got back to me :-(
NetworkGeezer Posted April 26, 2007 Posted April 26, 2007 A few years ago I set up a set of empty folders in all user home areas to encourage them to file work according to subject. So each user had /My Documents/ICT, /My Documents/Science etc.. Unfortunately I have lost the script which accomplished this. I know it was something I had to type in a terminal window, but that's about it. We are using MS Server 2003/XP Workstations with Ranger. Any ideas? Cheers. How are your student home folders arrange flat directroy or year group? The easier thing to do would be this CD for /f %%s in ('dir /ad/b') do MD "%%s\Subject" You can repeat the last line for as may subjects as you need, rembering to substitute ENGLISH, MATHS, SCIENCE etc for Subject.
plexer Posted April 26, 2007 Posted April 26, 2007 Why not just do it in a login script. if not exist h:\mathematics md h:\mathematics etc... Ben
scgf Posted April 26, 2007 Author Posted April 26, 2007 Thanks, NetworkGeezer. On our system, user folders on the server follow this pattern. Take John Smith in year 8: E:\Data\Users Home Directories\Students\04smithjo John's My Documents folder will be inside 04smithjo. All student folder are inside the Students directory and year groups are differentiated by the initial two digits - representing the year that cohort entered the school. How would your script work with this path? If you need a UNC it is \\Server1\Students\04smithjo - we share the Students folder, not each individual user's folder.
pooley Posted April 26, 2007 Posted April 26, 2007 I wanted a script to actually create the students HOME folder, not really bothered about any sub folders that may need creating. Any suggestions or do I just buy some folder creation software and be done
apeo Posted April 26, 2007 Posted April 26, 2007 This vbscript should work but not fully tested. Dim oFS0, oFS1, oFolder, WshShell, strPath, CreateFolder Set WshShell = WScript.CreateObject("WScript.Shell") Set oFS0 = WScript.CreateObject("Scripting.FileSystemObject") 'change get folder path strPath = "E:\Data\Users Home Directories\Students\" Set oFolder = oFS0.GetFolder(strPath) CreateFolders oFolder Sub CreateFolders(oF) Dim F For Each F In oF.subfolders 'Create directories for each folder in the above path Set oFS1 = CreateObject("Scripting.FileSystemObject") Set CreateFolder = oFS1.CreateFolder(strPath & "\" & F.name & "\My Documents\ICT") Set CreateFolder = oFS1.CreateFolder(strPath & "\" & F.name & "\My Documents\Science") Set CreateFolder = Nothing Set oFS1 = Nothing Next End Sub 'clean up set oFolder = nothing Set oFS0 = Nothing set wshshell = nothing EDIT: This doesnt check if the folder exist or not and will go through every folder in the students folder so be aware.
apeo Posted April 26, 2007 Posted April 26, 2007 I wanted a script to actually create the students HOME folder, not really bothered about any sub folders that may need creating. Any suggestions or do I just buy some folder creation software and be done So you want to creat multiple home directories with user details coming from a csv or something?
pooley Posted April 26, 2007 Posted April 26, 2007 yes m8 - got all user details in csv or if there is a way of interrogating AD and using the results from there I would use that too
plexer Posted April 26, 2007 Posted April 26, 2007 Pooley: Please start a new thread for your question as that doesn't appear to be what the original poster was after. Thanks, Ben
pooley Posted April 26, 2007 Posted April 26, 2007 Sorry didnt read the initial post - just hijacked it New posting on its way
scgf Posted April 26, 2007 Author Posted April 26, 2007 Thanks everyone for your help. I have implemented the login script that plexer suggested. It works a treat. Apeo - I have made a note of your VB script - thank you very much for this.
OutToLunch Posted April 26, 2007 Posted April 26, 2007 I sent a PM to Kyle back in January asking if he'd mind sending me the script, but he hasn't got back to me :-( Quick adaptation of my delete stuff from users directories script would do it... From the top level dir eg. D:\pupils CD D:\Pupils For /D %%I in (*) do mkdir D:\pupils\%%I\folder1 For /D %%I in (*) do mkdir D:\pupils\%%I\folder2 For /D %%I in (*) do mkdir D:\pupils\%%I\folder3 For /D %%I in (*) do mkdir D:\pupils\%%I\folder4 Someone could probably make it more efficient but as it's creating empty folders the repeated loops shouldn't be that much of a performance hit. Edit: Whoops, hands up if you left the thread open all morning then replied without refreshing it first to see if someone else had answered. *raises hand* :oops:
apeo Posted April 26, 2007 Posted April 26, 2007 CD D:\Pupils For /D %%I in (*) do mkdir D:\pupils\%%I\folder1 For /D %%I in (*) do mkdir D:\pupils\%%I\folder2 For /D %%I in (*) do mkdir D:\pupils\%%I\folder3 For /D %%I in (*) do mkdir D:\pupils\%%I\folder4 quote] Just a note, if the folders are to be created in a folder called "My Documents" you will need to change it abit. For /D %%I in (*) do mkdir "D:\pupils\%%I\my documents\folder1"
OutToLunch Posted April 26, 2007 Posted April 26, 2007 Whoops, my bad for not mentioning that there - don't use a "My Documents" folder in the home directories here, always looked at it as they're already in their own area so don't need an extra level to click down through.
tosca925 Posted April 26, 2007 Posted April 26, 2007 not sure f this is of any help now but copy the below into a batch file( you many need to edit for your own subjects.) and then drop the batch file in the shared folder with all your users in. then run it. I leave mine in the root of the year folder so i can get at it quick but i change permissions and hide it. Also you can run it 3 months later and it does not affect any of the current folders. it just reports they already exist. Its great if you get a couple of kids start after half term etc. You'll notice we have a Language folder and this script creates a folder for French and German inside of it. for /d %%i in (*) do Mkdir %%i\English Mkdir %%i\Maths Mkdir %%i\ICT Mkdir %%i\Languages\ Mkdir %%i\Languages\French Mkdir %%i\Languages\German Mkdir %%i\History Mkdir %%i\Science Mkdir %%i\Design.Tech Mkdir %%i\Heatlh.Social Mkdir %%i\P.E Mkdir %%i\R.E Mkdir %%i\Geography Mkdir %%i\Business.Studies Mkdir %%i\Art Mkdir %%i\Drama Mkdir %%i\Media.Studies Mkdir %%i\Personal Mkdir %%i\Social.Sciences Mkdir %%i\Social.Sciences\Psychology Mkdir %%i\Social.Sciences\Public.Services Mkdir %%i\Social.Sciences\Sociology Mkdir %%i\Politics Mkdir %%i\Music Mkdir %%i\P.S.E Mkdir %%i\Performing.Arts
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now