#76226 - 2003-07-30 05:23 AM
Mapping Drives via INI file
|
dataman_42
Lurker
Registered: 2003-07-30
Posts: 3
Loc: NSW Australia
|
I will try this again. I am trying to map drive for groups in a domain via an INI file. I have been using Diederik de Groot login.ix and am modifying as required.
I am trying to get the variable $group to change by using EnumGroup function with no success. It sees the groups but will no connect drives.
Any help would be appreciated.
code:
Function ConnectGroupDrives() ;****************************** ; GroupShares ;****************************** ;Initialise $group so it is not empty
$group=0
If Exist($FileLocation + "\shares.ini") If $group=0 For $x = 1 to 10 $group = EnumGroup($Index) $Index=$Index+1 $DriveDefinition = ReadProfileString($FileLocation + "\shares.ini", $group, "drive" + $x) If @ERROR = 0 If $DriveDefinition<>"" ConnectShare($DriveDefinition) EndIf Else Return EndIf Next EndIf EndIf EndFunction
SAMPLE Share.ini file [MAPAll] Drive1="F:, \\Server1\PUBLIC, MAPAll"
[CompServAdmin] Drive1="J:, \\Server1\CCshare,CCshare" Drive2="K:, \\Server1\e$,E" Drive3="L:, \\Server1\c$,C"
TIA ![[Smile]](images/icons/smile.gif) [ 30. July 2003, 05:23: Message edited by: dataman_42 ]
_________________________
dataman
|
|
Top
|
|
|
|
#76228 - 2003-07-30 02:08 PM
Re: Mapping Drives via INI file
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
dataman,
Did you get a chance to look at this?
I think this covers what you need in your request - ENUMINI() - Enumerate an INI file
It is really a MapDrive() UDF, but uses an INI database.
Note: It does not work with shares that have a space within them.
Kent
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 675 anonymous users online.
|
|
|