Cazzjh
Fresh Scripter
Registered: 2002-06-04
Posts: 32
Loc: Glasgow, Scotland
|
Thanks for that Howard - have modified it to be like :
code:
SELECT CASE INGROUP ("MOVED_USERS") GOSUB gla CASE INGROUP ("GRAMPIAN-GRP") GOSUB gra CASE INGROUP ("PRIME-GRP") GOSUB pri CASE INGROUP ("PANDD-GRP") GOSUB pan CASE 1 ; not in any of the above groups ENDSELECT
:PRI
MapDrive("J:", "LAPPNT02", "AREV31") MapDrive("F:", "LAPPNT02", "PSDATA")
RETURN
:PAN IF @INWIN = 1 SHELL 'SUBST U: /D ' SHELL 'SUBST U: "\\lbdcnt01\%username%" ' MapDrive("J:", "LFILNT01", "PearlAndDean") MapDrive("K:", "LAPPNT01", "ACT")
ELSE ; Win95 MapDrive("U:","lbdcnt01", "Users") CD U:\users\@userid MapDrive("J:", "LFILNT01", "PearlAndDean") MapDrive("K:", "LAPPNT01", "ACT") ENDIF
RETURN
:GLA ? "USERS NAME IS " + @fullname ? "MACHINE NAME IS " + @wksta ? "IP ADDRESS IS " + @ipaddress0 ? "CPU IS " + @cpu ? "OPERATING SYSTEM IS " + @producttype ? "SERVICE PACK IS " + @csd ? ? If @INWIN=1 If InGroup("IT-PRINT1-GRP") $null=AddPrinterConnection("\\Gfclnt04\CITSL4C1") $null=AddPrinterConnection("\\Gfclnt04\CITSLJ03") $null=AddPrinterConnection("\\Gfclnt04\AITSL502") $null=AddPrinterConnection("\\Gfclnt04\AITSL501") $null=SetDefaultPrinter("\\Gfclnt04\AITSL502") ? "Added printer connection.........." ENDIF
IF InGroup("IT-PRINT2_GRP") $null=AddPrinterConnection("\\Gfclnt04\CITSL4C1") $null=AddPrinterConnection("\\Gfclnt04\CITSLJ03") $null=AddPrinterConnection("\\Gfclnt04\AITSL502") $null=AddPrinterConnection("\\Gfclnt04\AITSL501") $null=SetDefaultPrinter("\\Gfclnt04\AITSL501") ? "Added printer connection.........." ENDIF If InGroup("checkline-grp") MapDrive("H:","GCKLNT01","wineftnt") Endif IF InGroup("MOVED_USERS") SHELL 'SUBST U: /D ' SHELL 'SUBST U: "\\gfclnt03\users\%username%" ' ENDIF
IF InGroup("RESEARCH-GRP") MapDrive("Z:","GAPPNT02","RESEARCH") ENDIF
Else ; Win95
IF InGroup("MOVED_USERS") MapDrive("U:","gfclnt03","users") CD U:\users\@userid ENDIF Endif :GRA IF @INWIN = 1 IF InGroup("LOCAL_ADMINS") SHELL "CMD /C SUBST U: /D" ELSE SHELL 'SUBST U: /D ' SHELL 'SUBST U: "\\QCLUNT01\users\%username%" ' ENDIF
ELSE ; win95
MapDrive("U:", "QCLUNT01", "users") cd U:\users\@USERID ENDIF
IF InGroup("Scottish Magazines") MapDrive("N:","GAPPNT04","ScottishMagazines") ENDIF
IF InGroup("Solus-Grp") MapDrive("Q:","GAPPNT04","SolusBookingSystem") ENDIF
IF InGroup("ADQUICK-GRP") MapDrive("G:","GTPSNT01","Quick") ENDIF
IF InGroup("CUSTSERV-GRP") MapDrive("R:","GAPPNT02","CSDBase") ENDIF
IF InGroup("SATEAM-GRP") MapDrive("X:","GMSHNT01","TECH_SUPPORT") ENDIF
IF InGroup("MOVE-GRP") MapDrive("J:","GFCLNT04","CentralServices") ENDIF
IF InGroup("CENTRALS-GRP") ; MapDrive("J:","GFCLNT04","CentralServices") ENDIF
IF InGroup("GPNCENTRALS-GRP") ; MapDrive("N:","QCLUNT01","CentralServices") ENDIF
IF InGroup("BROADCAS-GRP") MapDrive("K:","GFCLNT04","Broadcasting") ENDIF
IF InGroup("BROADDIST-GRP") MapDrive("I:","GFCLNT04","Broadcasting") ENDIF
IF InGroup("GPNBROADCAST-GRP") MapDrive("O:","QCLUNT01","Broadcasting") ENDIF
IF InGroup("PUBLISHI-GRP") MapDrive("L:","GFCLNT04","Publishing") ENDIF
IF InGroup("S1-GROUP") MapDrive("V:","GAPPNT03","S1") USE V: "\\GAPPNT03\S1" ENDIF
IF InGroup("COGNOS-USERS") MapDrive("Y:","GTPSNT01","cognos") ENDIF
IF InGroup("SUNDAY-GRP") MapDrive("S:","GMSHNT01","Sunday") ENDIF
IF InGroup("STE-GRP") MapDrive("M:","GFCLNT04","Broadcasting") ENDIF
IF InGroup("MARKETIN-GRP") MapDrive("T:","GAPPNT05","Despatch_DB") ENDIF
IF InGroup("MARKETDB-GRP") MapDrive("S:","GAPPNT05","NSDOCS") ENDIF
IF InGroup("MAGASUBS-GRP") MapDrive("F:","GAPPNT02","MAGAZINES") ENDIF
IF InGroup("GPNPUBLIC-GRP") ; MapDrive("Q:","QCLUNT01","Public") ENDIF
MapDrive("P:","GMSHNT01","Public")
RETURN
;-------------------------------------------------------------------------------------------------- Function MapDrive($Drive, $Server, $Share) Dim $Drive, $Server, $Share Color c+/n If $Drive<>"" and $Server<>"" and $Share<>"" $LogText="Connecting $Drive to \\$Server\$Share" ? $LogText USE $Drive /Delete /Persistent USE $Drive "\\$Server\$Share" If @error=0 color g+/n $x=" - Success" "$x" Else color r+/n $x=" - Failed: Error @error" "$x" $ErrorState=1 Endif WriteLog ($LogText + $x) Color w+/n Else WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'") Endif Endfunction ;-------------------------------------------------------------------------------------------------- Function WriteLog($text) dim $RC, $text, $LogFile, $Filehandle $Filehandle = 1 $LogFile = "\\Gfclnt03\Users\LoginLogs\logon.log" $RC=Writeline ($Filehandle, "@Date @Time - $Text" + Chr(13) + Chr(10)) if $RC<0 $RC=Close ($Filehandle) $RC=Open ($Filehandle, $LogFile, 5) Select Case $RC=-1 $RC=MessageBox ("Invalid file name ($LogFile) specified for log file.","Logon Script Error",48) Case $RC=0 WriteLog ($Text) Case $RC=>0 $RC=MessageBox ("Error($RC) while attempting to open log file ($LogFile).","Logon Script Error",48) Endselect Endif EndFunction
It still will not go to each section correctly. Have ran it through kixstrip and there are no errors. It just doesn't seem to be using the select statement correctly, doesn't matter if I change it to an if statement either - still will not work.
HELP!!!!!
_________________________
Cazzjh
|