Hello,
so I am using UDF and INI by now and can run a loop. Great.
Smaller skript (one looped "use") and an INI file for a lot of
parameters, that can be edited even by those who never touched
KiXtart before.
Unfortunately using the INI leads to another problem for me.
The UDF is not included in this little example, the mapping of
the drives will be executed with a Call fnMapDrive in kixbiblio.udf
in the real skript.
file: kixlogon.kix
Code:
$inipath = "D:\Tools\KiX\kixlogin.ini"
FOR $Counter = 1010 to 1030 step 10
$aktDrive = ReadProfileString("$inipath", "$Counter", "Drive")
$aktPath = ReadProfileString("$inipath", "$Counter", "Path")
$aktGroup = ReadProfileString("$inipath", "$Counter", "Group")
IF INGROUP ($aktGroup) = 1
? "Connecting $aktdrive " use $aktdrive "\\"+"$aktpath"
ENDIF
next
file: kixlogin.ini
Code:
[1010]
Drive="G:"
Path="server1\all"
Group="domain\company-all-g"
[1020]
Drive="H:"
Path="server1\home\@userid"
Group="domain\company-all-g"
[1030]
Drive="I:"
Path="server1\it$"
Group="domain\IT-read-g","domain\IT-write-g"
This works for 1010 well.
1020 works not because of @userid beeing not translated into the username,
if I put my loginname/username instead of @userid it works, but is not var anymore.
1030 works not because of the two Groups, if I only use one, it works.
But using the "Group1 or Group2 or Group3"-Array for the mapping keeps the INI smaller.
1020 and 1030 do work if I include them as $xy="..." into the skript itself. (Like done before
in one big skript and not in the INI)
We are having a lot of mappings depending upon membership in one OR another group, and I would not
like to have all of those as single entries in the INI file. Would be big and ugly like the netlogon.cmd
before.
The @userid - feature is needed within the loginskript, because we have a lot of mappings that will be made
with username from mydomain, but also with the same username from anotherdomain.
net use x: \\server1\share1 /user:mydomain\JohnDoe
net use y: \\server2\share2 /user:anotherdomain\JohnDoe
net use z: \\server3\share3 /user:yetanotherdomain\JohnDoe
I am at the point to use a loop with the INI, but fail at most mappings,
or to keep all in one working skript without a loop.
Any commands, ideas, chars like ""() or topics in the forum I did miss?
Regards,
Carsten