Ok, I accepted the fact that readprofilestring() can't create strings over 32000 chars, so I decided to split the ini files to parts of 1600 groups per file (1600 * 20 (max group chars) = 32000) like this :
creation :
Code:
$_ = writeprofilestring($sTargetFolder + '\grp\grp' + $c/1600 + '.ini',$item,"Desc",$a)
where $c is a passed for-next counter
readout :
Code:
dim $a, $c
$c = 0
while exist($sTargetFolder + '\grp\grp' + $c + '.ini')
$a = $a + readprofilestring($sTargetFolder + '\grp\grp' + $c + '.ini','','') + chr(10)
$c = $c + 1
loop
$a = left($a,-1)
$Enum_GRP = split($a,chr(10))
this works ok, allthough the string grows over 32000 chars in length
Now, as I tested this in a German environment where domain equals Domäne, I have lost some groups during export as a shelled net group command seems to deny working with 'umlauts' [äöü] (do you have a word for this in English ?) ...
the following line fails (ASCII is ON):
Code:
shell '%ComSpec% /c net group "' + $item + '" /domain > "' + $tmpfile + '" 2>nul'
where $item = 'Domänen-Admins' or something similar...
On the other side typing the command at command prompt works ok
Any insight there ?
thanx in advance