Jump to content

Recommended Posts

Posted

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.

Posted
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.
Posted
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. :lol:

  • 3 months later...
Posted
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 :-(
Posted
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.

Posted

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.

Posted

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 ;)

Posted

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.

Posted
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?

Posted

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.

Posted
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:

Posted

 

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"

Posted
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.
Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...