For anyone interested...
 Code:
;Version 1.2.14.08
;
;
;Function ENUMINI() taken from Kent Dyer,Jens Meyer,Howard Bullock
;and modified for more fields and stopping double entries


BREAK OFF
$ = SetOption('Explicit', 'On')
$ = SetOption('NoMacrosInStrings', 'On')


DIM $osname,$inifile
GLOBAL $vista,$personal_loc,$desktop_loc,$start_loc,$logfilepath



$osname=left(@ProductType,10)
$vista=0

;----------------------------------------------script variables
$logfilepath="S:\logfile.txt"
$inifile="C:\Documents and Settings\duo\Desktop\newlogscript\sample.ini"

if $osname="Windows Vi"
	;Vista Paths
	$vista=1
	$personal_loc="S:\icons\"
	$desktop_loc="C:\Users\"+@USERID+"\Desktop\"
	$start_loc="C:\Users\"+@USERID+"\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\"
else
	;XP,2k,2k3 Paths
	$personal_loc="S:\icons\"
	$desktop_loc="C:\documents and settings\"+@USERID+"\desktop\"
	$start_loc="C:\documents and settings\"+@USERID+"\start menu\programs\apps\"
endif
;--------------------------------------------------------














ENUMINI($inifile)	;processes the ini file and takes all specified actions


;testing stuff----stay away!----

;RUN "\\srv05wts\keyfinder\keyfinder.exe /save \\srv05wts\logs$\ /close"

;new thing testing
;if $vista=1
;$filetransfer ='robocopy "%USERPROFILE%\Documents" "S:\My Documents" /MOV /XO';endif
;else
;$filetransfer ='robocopy "%USERPROFILE%\My Documents" "S:\My Documents" /MOV /XO';endif
;endif
;Run $filetransfer
;end test



























FUNCTION ENUMINI($fl)
DIM $sections,$keys,$sectionkey,$sectionentry,$rc,$resource,$commands,$desc,$function,$count
$sections=split(readprofilestring($fl,'',''),chr(10))
	FOR EACH $sectionentry IN $sections
		IF $sectionentry <>''
			$keys=split(readprofilestring($fl,$sectionentry,''),chr(10))
			FOR EACH $sectionkey IN $keys
				IF $sectionkey <>''
					;? 'Key "'+$sectionkey+'" = "'+readprofilestring($fl,$sectionentry,$sectionkey)+'"'
					$resource=readprofilestring($fl,$sectionentry,$sectionkey)
					If InStr($resource, '@USERID')
						$resource = Join(Split($resource, '@USERID'), @USERID)
					EndIF
				IF INGROUP($sectionentry) | @hostname=$sectionentry
					$commands=split('$resource',',')
					$count=0
					For Each $desc IN $commands
					$count=$count+1
						if $count=2; this is nessicary do to the fact that the For Each is running each item twice, essentially a modulus
						;function=$sectionkey desc is=$commands[0] command=$commands[1]
						;? $desc $sectionkey
						run_functions($sectionkey,$commands[0],$commands[1], $commands[2], $commands[3])
						endif
					Next

				ENDIF
				ENDIF
			NEXT
		ENDIF
	NEXT
ENDFUNCTION






function run_functions($function,$desc,$command,$command2,$command3)
$function=left($function,5)


	Select
	case $function="400dr"
		;?"400drive to be mapped is " $desc ":\ from " $command2$command
		graphical400($desc,$command,$command2)
	case $function="drive"
		;? "drive to be mapped is " $desc ":\  from " $server$command
		drive_mapping($desc,$command,$command2)
	case $function="print"
		;? "printer to be mapped is " $desc " from " $printserver$command
		printer_mapping($command2,$command)
	case $function="copyf"
		copy_files($personal_loc,$desktop_loc,$start_loc,$command2,$command)
		? $command
	case $function="regha"
		;? "path is "$desc @CRLF" key is " $command " value " $command2 " type " $command3
		registry_fixes($desc, $command, $command2, $command3)
	case $function="runap"
		;? "command 1 $command @CRLF command 2 $command2"
		Run '$command2$command'
		
	case 1
		error_check(@ERROR,@SERROR,"improper function in run_functions")
	Endselect


endfunction













function copy_files($personal,$desktop,$start,$server,$program)
DIM $file
$file=$server + "icons$\" + $program
	if not exist ("$personal")
		md "S:\icons\"
	endif
	if not exist ("$personal$program")
		;? "need in personal drive"
		COPY "$file" "$personal" /c
		error_check(@ERROR,@SERROR,"couldnt copy $file to $personal")
	endif
	if not exist ("$desktop$program")
		;? "need in desktop"
		COPY "$file" "$desktop" /c
		error_check(@ERROR,@SERROR,"couldnt copy $file to $desktop")
	endif
	if not exist ("$start")
		md "C:\documents and settings\"+@USERID+"\start menu\programs\apps\"
	endif
	if not exist ("$start$program")
		;? "need in startmenu"
		COPY "$file" "$start" /c
		error_check(@ERROR,@SERROR,"couldnt copy $file to $start")

	endif
endfunction









function drive_mapping($drive,$share,$server)
	$share='$server$share'


	? "mapping "+ $drive +" to "+ $share
	Use $drive /Delete
		if @ERROR <> "2250"
		error_check(@ERROR,@SERROR,"failed to remove $drive drive")
		endif

	Use $drive $share
		error_check(@ERROR,@SERROR,"failed to map $drive drive")
		if $drive="S"
			update_logfile()
		endif
endfunction











function printer_mapping($server,$printer)
	If AddPrinterConnection("$server$printer")=0
		? "Added $printer"
	else
		error_check(@ERROR,@SERROR,"couldnt add $printer from $server")
endfunction







function registry_fixes($path,$field,$value,$type)
	WriteValue($path, $field, $value, $type)
	error_check(@ERROR,@SERROR,"Couldnt modify $field")

endfunction















function error_check($errnum,$error,$message)
	If @ERROR<>0
		Open(1,$logfilepath, 5)
		WriteLine(1, @DATE + " " + @TIME + " Error# $errnum $error occured, $message" + Chr(13) + Chr(10))
		Close(1)
	EndIf
endfunction











function update_logfile()
		Open(1,$logfilepath, 5)
		WriteLine(1, @CRLF + @DATE + " " + @TIME + " LogonServer=" + @LDRIVE + " Computer=" + @HOSTNAME + Chr(13) + Chr(10))
		Close(1)
endfunction





function graphical400($drive,$share,$server)
Dim $choice,$400username,$400password,$passlen,$userlen,$count
$count=0
$userlen=0
$passlen=0
		if exist("$drive")
			? "You already have"+$drive
		else
			$share=$server + $share
			? "mapping $drive to $share"


			$choice = MessageBox("Do you want to map "+$drive+" to "+$share+"?", "AS400 Drives", 36)
			If $choice = 6 ;6=yes to question
				while ($400username=@CRLF|$userlen=0)
					cls
					color y+/n
					? "Please enter your AS400 Username"+@CRLF
					color g+/n
					GETS $400username
					$userlen=len($400username)
				loop

				while ($400password=@CRLF|$passlen=0)
					cls
					color y+/n
					? "Please enter your AS400 Password"+@CRLF
					color g+/n
					GETS $400password
					$passlen=len($400password)
				loop
				
				Use $drive /Delete
				if @ERROR <> "2250"
					error_check(@ERROR,@SERROR,"failed to remove $drive drive")
				endif
				Use $drive $share /user:$400username /password:$400Password
					error_check(@ERROR,@SERROR,"failed to map $drive drive")
				endif
endfunction