I have very little knowledge of scripting so please bear with me.
I currently have 1500 users who each have ther Homepath via user
account in AD. They all have a home directory folder on the a server.
What we need to do is create a folder structure inside the individual
users folder. ie:

folder called Bill already exits. i want to add a folder structure that
looks like this.

Bill \maths
\english
\french
\german

Can this be done via a logon script or a script that is run locally on
the server which hosts the home directories.

We are trying to put the folder structure in place to try and encourage
users to be more organised.They already have files and folders in hteir
directory so we want to add these folder and encorage them to re
arranged.
We are a educational establishment and some of the kids are not too
organised.

Re: Create folder structure inside current folder. by McKirahan

McKirahan
Wed May 25 06:03:02 CDT 2005

"Woody" <TOSCA925@YAHOO.CO.UK> wrote in message
news:1117016062.703730.218960@o13g2000cwo.googlegroups.com...
> I have very little knowledge of scripting so please bear with me.
> I currently have 1500 users who each have ther Homepath via user
> account in AD. They all have a home directory folder on the a server.
> What we need to do is create a folder structure inside the individual
> users folder. ie:
>
> folder called Bill already exits. i want to add a folder structure that
> looks like this.
>
> Bill \maths
> \english
> \french
> \german
>
> Can this be done via a logon script or a script that is run locally on
> the server which hosts the home directories.
>
> We are trying to put the folder structure in place to try and encourage
> users to be more organised.They already have files and folders in hteir
> directory so we want to add these folder and encorage them to re
> arranged.
> We are a educational establishment and some of the kids are not too
> organised.
>

What is the folder above "Bill"?



Re: Create folder structure inside current folder. by McKirahan

McKirahan
Wed May 25 06:22:15 CDT 2005

"McKirahan" <News@McKirahan.com> wrote in message
news:DbidnQ30Vtj7xgnfRVn-rg@comcast.com...
> "Woody" <TOSCA925@YAHOO.CO.UK> wrote in message
> news:1117016062.703730.218960@o13g2000cwo.googlegroups.com...
> > I have very little knowledge of scripting so please bear with me.
> > I currently have 1500 users who each have ther Homepath via user
> > account in AD. They all have a home directory folder on the a server.
> > What we need to do is create a folder structure inside the individual
> > users folder. ie:
> >
> > folder called Bill already exits. i want to add a folder structure that
> > looks like this.
> >
> > Bill \maths
> > \english
> > \french
> > \german
> >
> > Can this be done via a logon script or a script that is run locally on
> > the server which hosts the home directories.
> >
> > We are trying to put the folder structure in place to try and encourage
> > users to be more organised.They already have files and folders in hteir
> > directory so we want to add these folder and encorage them to re
> > arranged.
> > We are a educational establishment and some of the kids are not too
> > organised.
> >
>
> What is the folder above "Bill"?

Modify "Const cFOL" for your folder above "Bill".

'****
'* This Visual Basic Script (VBS) does the following:
'* 1) For all subfolders under a given folder (cFOL),
'* 2) Add new subfolders to each per an array (cSUB).
'****
Option Explicit
'*
'* Declare Constants
'*
Const cVBS = "addsubfolders.vbs"
Const cFOL = "C:\temp"
Const cSUB = "maths,english,french,german"
'*
'* Declare Variables
'*
Dim intFOL
intFOL = 0
Dim strFOL
Dim arrSUB
arrSUB = Split(cSUB,",")
Dim intSUB
Dim strSUB
'*
'* Declare Objects
'*
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objGFO
Set objGFO = objFSO.GetFolder(cFOL)
Dim objFOL
Set objFOL = objGFO.SubFolders
'*
'* Add Subfolders
'*
If objFSO.FolderExists(cFOL) Then
For Each strFOL In objFOL
intFOL = intFOL + 1
For intSUB = 0 To UBound(arrSUB)
strSUB = arrSUB(intSUB)
'WScript.Echo cFOL & "\" & strFOL.Name & "\" & strSUB
objFSO.CreateFolder(cFOL & "\" & strFOL.Name & "\" & strSUB)
Next
Next
End If
'*
'* Destroy Objects
'*
Set objFOL = Nothing
Set objGFO = Nothing
Set objFSO = Nothing
'*
'* Finish
'*
MsgBox intFOL & " folders processed.",vbInformation,cVBS



Re: Create folder structure inside current folder. by Woody

Woody
Wed May 25 06:51:41 CDT 2005

Thank you very much indeed. It worked a treat.

I really appreciate your fast response. I see have a lot to learn yet.

Again Thankyou.


Re: Create folder structure inside current folder. by Woody

Woody
Wed May 25 07:19:54 CDT 2005

I am going to be cheeky now and ask if you can help me with this script
dilema i have before i create another post in the group.
I am using this script below to create the permissions on the users
Home Area which gives them Full Control, Administrator Full Control and
Staff Modify.

What i want to be able to do with a new script is only give read access
to the root of the pupils home directory but full control of the
folders (and subfolders which they will be able to create themselves)
of the folder structure i have created for them.

I currently use this.

Const ForAppending = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("c:\sec.bat", ForAppending,
True)

REM
********************************************************************************
Set objOU = GetObject ("LDAP://ou=ENTRY 97,OU=PUPILS,DC=LIB,=UK")
REM
********************************************************************************

For each objuser in objOU

REM
********************************************************************************
commandtorun = "CACLS
"&chr(34)&"D:\HOMEDIRS\entry97\"&objUser.SAMAccountName&chr(34)&" /T /C
/P "&chr(34)&objUser.SAMAccountName&chr(34)&":F administrator:F
STAFFG:C <c:\y.txt"
REM
********************************************************************************

Set WshShell = CreateObject("WScript.Shell")
REM WshShell.Run commandtorun, 1, TRUE

objTextFile.WriteLine(commandtorun)
objTextFile.WriteLine(attribcommand)

REM This will make the account not expire DO NOT USE IF WANT USER TO
CHANGE PASSWORD WHEN LOG ON

Next
objTextFile.Close


REM RUN VBS FILE
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "c:\sec.bat", 1, TRUE
REM objFSO.DeleteFile("C:\sec.bat")
Wscript.Echo "User Security has been set"

Any ideas?


Re: Create folder structure inside current folder. by Woody

Woody
Wed May 25 07:20:32 CDT 2005

I am going to be cheeky now and ask if you can help me with this script
dilema i have before i create another post in the group.
I am using this script below to create the permissions on the users
Home Area which gives them Full Control, Administrator Full Control and
Staff Modify.

What i want to be able to do with a new script is only give read access
to the root of the pupils home directory but full control of the
folders (and subfolders which they will be able to create themselves)
of the folder structure i have created for them.

I currently use this.

Const ForAppending = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("c:\sec.bat", ForAppending,
True)

REM
********************************************************************************
Set objOU = GetObject ("LDAP://ou=ENTRY 97,OU=PUPILS,DC=LIB,=UK")
REM
********************************************************************************

For each objuser in objOU

REM
********************************************************************************
commandtorun = "CACLS
"&chr(34)&"D:\HOMEDIRS\entry97\"&objUser.SAMAccountName&chr(34)&" /T /C
/P "&chr(34)&objUser.SAMAccountName&chr(34)&":F administrator:F
STAFFG:C <c:\y.txt"
REM
********************************************************************************

Set WshShell = CreateObject("WScript.Shell")
REM WshShell.Run commandtorun, 1, TRUE

objTextFile.WriteLine(commandtorun)
objTextFile.WriteLine(attribcommand)

REM This will make the account not expire DO NOT USE IF WANT USER TO
CHANGE PASSWORD WHEN LOG ON

Next
objTextFile.Close


REM RUN VBS FILE
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "c:\sec.bat", 1, TRUE
REM objFSO.DeleteFile("C:\sec.bat")
Wscript.Echo "User Security has been set"

Any ideas?


Re: Create folder structure inside current folder. by McKirahan

McKirahan
Wed May 25 07:28:35 CDT 2005

"Woody" <TOSCA925@YAHOO.CO.UK> wrote in message
news:1117023632.604248.114780@z14g2000cwz.googlegroups.com...
> I am going to be cheeky now and ask if you can help me with this script
> dilema i have before i create another post in the group.
> I am using this script below to create the permissions on the users
> Home Area which gives them Full Control, Administrator Full Control and
> Staff Modify.
>
> What i want to be able to do with a new script is only give read access
> to the root of the pupils home directory but full control of the
> folders (and subfolders which they will be able to create themselves)
> of the folder structure i have created for them.
>
> I currently use this.
>
> Const ForAppending = 2
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objTextFile = objFSO.OpenTextFile ("c:\sec.bat", ForAppending,
> True)
>
> REM
>
****************************************************************************
****
> Set objOU = GetObject ("LDAP://ou=ENTRY 97,OU=PUPILS,DC=LIB,=UK")
> REM
>
****************************************************************************
****
>
> For each objuser in objOU
>
> REM
>
****************************************************************************
****
> commandtorun = "CACLS
> "&chr(34)&"D:\HOMEDIRS\entry97\"&objUser.SAMAccountName&chr(34)&" /T /C
> /P "&chr(34)&objUser.SAMAccountName&chr(34)&":F administrator:F
> STAFFG:C <c:\y.txt"
> REM
>
****************************************************************************
****
>
> Set WshShell = CreateObject("WScript.Shell")
> REM WshShell.Run commandtorun, 1, TRUE
>
> objTextFile.WriteLine(commandtorun)
> objTextFile.WriteLine(attribcommand)
>
> REM This will make the account not expire DO NOT USE IF WANT USER TO
> CHANGE PASSWORD WHEN LOG ON
>
> Next
> objTextFile.Close
>
>
> REM RUN VBS FILE
> Set WshShell = CreateObject("WScript.Shell")
> WshShell.Run "c:\sec.bat", 1, TRUE
> REM objFSO.DeleteFile("C:\sec.bat")
> Wscript.Echo "User Security has been set"
>
> Any ideas?
>

"Const ForAppending = 2" is wrong:

ForReading = 1 ' Open a file for reading only. You can't write to this
file.
ForWriting = 2 ' Open a file for writing. If a file with the same name
exists, its previous contents are overwritten.
ForAppending = 8 ' Open a file and write to the end of the file.


Other than that, start a new post for this problem.



Re: Create folder structure inside current folder. by Woody

Woody
Wed May 25 07:48:55 CDT 2005

You've lost me now..................but many thanks again for helping
me out.


Re: Create folder structure inside current folder. by McKirahan

McKirahan
Wed May 25 07:56:28 CDT 2005

"Woody" <TOSCA925@YAHOO.CO.UK> wrote in message
news:1117025335.663687.185830@g44g2000cwa.googlegroups.com...
> You've lost me now..................but many thanks again for helping
> me out.
>

Your value for "ForAppending" is actually the value for "ForWriting".