First of all let me start by saying these scripts rock.. WHO"S HOUSE??? Bryce's HOUSE!!. Ok now that that has been said. I wanted to add a module to the script that would automatically create icons on the desktop. I did this in another script.. but I'm trying to be slick and "modulerize" it. .. it's almost there.. but it seems like it isn't pushing the values correctly to the functions.. let me layout the steps I took to add my module

1) added Module9 = All|G!Domain Users|Create_icons to the [Module_run_order]section of the ini
2) created the [Create_icons] section in the ini with the following in it.

;set status to ON if you want to run this Module
status = on

;set the TotalActions to equal the total number of drive mappings actions
TotalActions = 3

; The Create Icon entires should be in this format.
; please see logon-readme.txt for a full explanation on "OS type" and "Group membership".
; action# = OS Type | Group Membership | path | targetpath | arguments | working location | iconpath | window style

action1 = all|G!Domain users|%userprofile%\desktop\Groupwise 5.lnk|C:\novell\groupwise\grpwise.exe|/@@u-?|C:\novell\groupwise||
action2 = all|G!Domain users|%userprofile%\desktop\Forms.lnk|http://intranet.mhcuc.org/forms/forms.htm|||F:\APPS\ICONS\doc04.ico|
action3 = all|G!MASONICDATABASE|%userprofile%\desktop\Masonic Database.lnk|f:\data\sri\masonic.mdb||F:\DATA\SRI||7

3) Create create_icons.kix in the module folder with the following in it:

; this is the drive mapping routine.
; 0| 1| 2| 3| 4| 5| 6| 7
; OS| Group Membership | path | targetpath | arguments | working location | iconpath | window style
; action1 = all|GDomain Admins|\\Houston\admin|w:

DIM $ModuleData, $TotalActions, $actions

$totalActions = val(readvalue("$ConfigRegkey\$Module","TotalActions"))

? "Creating Icons"
for $action = 1 to $totalActions

$moduledata = split(readvalue("$ConfigRegkey\$Module","action$action"),"|")

select
case Ubound($moduledata) <> 7
? "There is an error in the Config.ini file"
case OS($Moduledata[0]) = 1 AND GroupCode($moduledata[1]) = 1
$nul = WshShortCut($moduledata[2],$moduledata[3],$moduledata[4],$moduledata[5],$moduledata[6],$moduledata[7])
endselect
Next
Exit(0)

4) Added the following function to kix_ functions.kix:

Function WshShortCut($path,$targetpath,optional $arguments, optional $startdir, optional $iconpath, optional $style)
dim $shell,$shortcut,$icosep,$ifile,$iindex
$shell = createobject("wscript.shell")
if $shell
$shortcut = $shell.createshortcut("$path")
if $shortcut $shortcut.targetpath = $targetpath
if $arguments $shortcut.arguments = $arguments endif
if $startdir $shortcut.workingdirectory = $startdir endif
if $iconpath $shortcut.iconlocation = $iconpath endif
if $style $shortcut.windowstyle = $style endif
$shortcut.save
if instr("$path",".url") and $iconpath
$icosep=instr("$iconpath",",")
if $icosep>0
$ifile=left("$iconpath",instr("$iconpath",",")-1)
$iindex=right("$iconpath",len("$iconpath")-$icosep)
else
$ifile=$iconpath
endif
$=writeprofilestring("$path","InternetShortcut","IconFile","$ifile")
$=writeprofilestring("$path","InternetShortcut","IconIndex","$iindex")
endif
$shortcut = 0
endif
$shell = 0
endif
exit @error
EndFunction

As part as my testing I put (but removed it before I pasted it here) ? statements in the module and function that printed the values to see if it was picking up them up like it was suppose to. What I found was that the module was getting the values but the function looked like it only got the first letter of the values. Please help..

Stephen

P.S. Hopefully my cut and pastes aren't to ugly.

_________________________
Big dogs take Big Bites