#45722 - 2003-09-20 07:49 PM
Creating Folder Structures using an INI file
|
Grasshopper75
Getting the hang of it
Registered: 2002-01-15
Posts: 99
Loc: Melbourne, Australia
|
Hi All,
I'm attempting to create a new folder structure for my company using kix and an INI file. Basically what I am after is the following
code:
Group |_ Department |_Team |_Folder A |_Folder B
I am structuring my INI file as follows
code:
[Department] Group=Groupname Team=Teamname
Any ideas how I can use the ReadProfileString to create this folder structure ? I'm having troubles reading in all the sections as it appears to add a CRLF at the end which kills my script to create the folder structre.
code:
$inifile="T:\groups.ini"
$x=ReadProfileString($inifile,"","") $y=ReadProfileString($inifile,$x,"Group") $z=ReadProfileString($inifile,$x,"Team")
Use x: "\\datl003n\Corporate"
MD "x:\"+$y+"\"+$x MD "x:\"+$y+"\"+$x+"\"+$z
Use x: /delete
Any help would be appreciated.
Cheers, Grasshopper75 [ 20. September 2003, 20:03: Message edited by: Grasshopper75 ]
|
|
Top
|
|
|
|
#45723 - 2003-09-20 08:15 PM
Re: Creating Folder Structures using an INI file
|
kholm
Korg Regular
   
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
ReadProfileString($inifile,"","") Returnes a string with all sections in the inifile, separated by Chr(10), AND ending with Chr(10)
If only one section exist the returned value by: ReadProfileString($inifile,"","") is the sectionname + chr(10)
You could try using this:
code:
$inifile="T:\groups.ini"
$s=Split(ReadProfileString($inifile,"",""),Chr(10)) For Each $x In $s If $x $y=ReadProfileString($inifile,$x,"Group") $z=ReadProfileString($inifile,$x,"Team") Use x: "\\datl003n\Corporate" MD "x:\"+$y+"\"+$z MD "x:\"+$y+"\"+$x+"\"+$z Use x: /delete EndIf Next
-Erik
|
|
Top
|
|
|
|
#45726 - 2003-09-20 11:08 PM
Re: Creating Folder Structures using an INI file
|
Grasshopper75
Getting the hang of it
Registered: 2002-01-15
Posts: 99
Loc: Melbourne, Australia
|
I got it working thanks to kholm ! You saved me about 3 days work. Thanks.
code:
$inifile="c:\groups.ini"
$s=Split(ReadProfileString($inifile,"",""),Chr(10)) For Each $x In $s $y=ReadProfileString($inifile,$x,"Group") $z=ReadProfileString($inifile,$x,"Team")
MD "c:\"+$y+"\"+$x+"\"+$z MD "c:\"+$y+"\"+$x+"\"+$z+"\A" MD "c:\"+$y+"\"+$x+"\"+$z+"\B" MD "c:\"+$y+"\"+$x+"\"+$z+"\C" MD "c:\"+$y+"\"+$x+"\"+$z+"\A\CONTROLLED ACCESS" MD "c:\"+$y+"\"+$x+"\"+$z+"\B\CONTROLLED ACCESS" MD "c:\"+$y+"\"+$x+"\"+$z+"\C\CONTROLLED ACCESS"
Next
Cheers, Grasshopper75
|
|
Top
|
|
|
|
#45727 - 2003-09-20 11:39 PM
Re: Creating Folder Structures using an INI file
|
Grasshopper75
Getting the hang of it
Registered: 2002-01-15
Posts: 99
Loc: Melbourne, Australia
|
Now if anyone knows of a command line utility to set Advanced W2K permissions I'd be set. I need to do List permissions which neither CACLS or XCACLS seem to do.
Cheers, Grasshopper75
|
|
Top
|
|
|
|
#45729 - 2003-09-20 11:55 PM
Re: Creating Folder Structures using an INI file
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Les, you seem to have fallen in love with SubInAcl
|
|
Top
|
|
|
|
#45731 - 2003-09-21 06:50 PM
Re: Creating Folder Structures using an INI file
|
Grasshopper75
Getting the hang of it
Registered: 2002-01-15
Posts: 99
Loc: Melbourne, Australia
|
I found a similar program and its free ! Does all permissions without the problems of SubinACL (Q296865) .
Its called SetACL and can be found here
|
|
Top
|
|
|
|
#45734 - 2003-09-21 11:03 PM
Re: Creating Folder Structures using an INI file
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Q296865 only applies to certains versions of Subinacl.
Version 4.0.1.1613 does not have those problems.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 696 anonymous users online.
|
|
|