#32484 - 2002-11-15 05:31 AM
Re: not mapping
|
Steve M
Fresh Scripter
Registered: 2002-05-08
Posts: 40
Loc: Orange,California
|
Here is my code cleaned up per your sugestions. This code is on my test server so only the server name is different in this code. I took a user and put him in all the escroe groups, trakker, usbank, and stat. he got all the mappings K,L,M,N,O,S and U. However he never got the I to apps or the T to apps Feeling really frustrated. code:
SHELL "winset.exe USERNAME=@USERID" BREAK ON ;(re)set Ctrl-C/Break handling COLOR r+/n ; CLS ; small Color b+/n BOX (7,20,17,61,FULL) ; Color w+/n ; IF ((@time > "00:00:00") AND (@time < "12:00:00")) at (9,22) "Good Morning," ELSE IF ((@time >= "12:00:00") AND (@time < "18:00:00")) at (9,22) "Good Afternoon," ELSE at (9,22) "Good Evening," ENDIF ENDIF ; at (10,22) @fullname at (12,22) "Please Wait For Logon script Execution" at (13,22) "Progress"
$drive="\\dc1\"+@userid+chr(36) USE U: $drive sleep 3
DelKey("HKEY_CURRENT_USER\Software\KiXtart\TokenCache")
if INGROUP("TRAKKER") USE L: /delete /Persistent use L: "\\dc1\TRAKKER" ? "Member of Trakker group" endif sleep 3
if INGROUP("ESCROW-REO") USE S: /delete /Persistent use S: "\\dc1\REO$" ? "Member of ESCROW-REO group" endif sleep 3
if INGROUP("ESCROW-UNIT1") USE k: /delete /Persistent use K: "\\dc1\ESCROW-UNIT1$" ? "Member of ESCROW-UNIT1 group" endif sleep 3
if INGROUP("ESCROW-UNIT2") USE L: /delete /Persistent use L: "\\dc1\ESCROW-UNIT2$" ? "Member of ESCROW-UNIT2 group" endif sleep 3
if INGROUP("ESCROW-UNIT3") USE M: /delete /Persistent use M: "\\dc1\ESCROW-UNIT3$" ? "Member of ESCROW-UNIT3 group" endif sleep 3
if INGROUP("ESCROW-UNIT4") USE N: /delete /Persistent use N: "\\dc1\ESCROW-UNIT4$" ? "Member of ESCROW-UNIT4 group" endif sleep 3
if INGROUP("ESCROW-UNIT5") USE O: /delete /Persistent use O: "\\dc1\ESCROW-UNIT5$" ? "Member of ESCROW-UNIT5 group" endif sleep 3
if INGROUP("LED") ? "Member of LED group" USE G: /delete /Persistent use G: "\\ATC-CORP\VOL2" USE S: /delete /Persistent use S: "\\dc1\LED$" If Exist ("c:\windows\\DESKTOP\TRAKKE~1.PIF") = 0 copy "\\dc1\netlogon\TRAKKE~1.PIF" "c:\windows\desktop" ;copies Trakker Star shortcut to desktop If Exist ("c:\windows\\DESKTOP\TRAKKE~2.PIF") = 0 copy "\\dc1\netlogon\TRAKKE~2.PIF" "c:\windows\desktop" ;copies Trakker Lend shortcut to desktop If Exist ("c:\windows\\DESKTOP\STARDO~1.PIF") = 0 copy "\\dc1\netlogon\STARDO~1.PIF" "c:\windows\desktop" ;copies Star Docnet shortcut to desktop endif endif endif sleep 3
if INGROUP("STAT") USE I: /delete /Persistent USE I: "\\dc1\Apps" ? "Member of STAT group" endif sleep 10
if INGROUP("USBANK") USE T: /delete /Persistent use T: "\\dc1\Apps" ? "Member of USBANK group" endif sleep 10
if INGROUP("Domain Admins") ? "Member of Domain Admins group"
USE G: /delete /Persistent use G: "\\ATC-CORP\VOL2" USE L: /delete /Persistent use L: "\\dc1\TRAKKER" If Exist ("c:\windows\\DESKTOP\TRAKKE~1.PIF") = 0 If Exist ("c:\windows\\DESKTOP\TRAKKE~2.PIF") = 0 If Exist ("c:\windows\\DESKTOP\ESCROW~1.PIF") = 0 If Exist ("c:\windows\\DESKTOP\REOESC~1.PIF") = 0 If Exist ("c:\windows\\DESKTOP\STARDO~1.PIF") = 0
copy "\\dc1\netlogon\TRAKKE~1.PIF" "c:\windows\desktop" ;copies Trakker Star shortcut to desktop copy "\\dc1\netlogon\TRAKKE~2.PIF" "c:\windows\desktop" ;copies Trakker Lend shortcut to desktop copy "\\dc1\netlogon\ESCROW~1.PIF" "c:\windows\desktop" ;copies Escrow Docnet shortcut to desktop copy "\\dc1\netlogon\REOESC~1.PIF" "c:\windows\desktop" ;copies Reo Escrow Docnet shortcut to desktop copy "\\dc1\netlogon\STARDO~1.PIF" "c:\windows\desktop" ;copies Star Docnet shortcut to desktop ENDIF ENDIF ENDIF ENDIF ENDIF sleep 10
if INGROUP("DOMAIN USERS") ? "Member of DOMAIN USERS" If Exist ("c:\windows\RD*") = 0 copy "\\dc1\netlogon\RD.BAT" "c:\windows" copy "\\dc1\netlogon\RD.PIF" "c:\windows" If Exist ("c:\windows\MSTS*") = 0 copy "\\dc1\netlogon\MSTSC.EXE" "c:\windows" If Exist ("c:\windows\MSTSCAX.DLL") = 0 copy "\\dc1\netlogon\MSTSCAX.DLL" "c:\windows" ENDIF ENDIF ENDIF sleep 3
[ 15. November 2002, 06:44: Message edited by: Steve M ]
_________________________
Steve
|
Top
|
|
|
|
#32485 - 2002-11-15 06:54 AM
Re: not mapping
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Steve,
Running this code through KiXstrip (note the error lines):
quote:
;($begin) ; ; thu 14-nov-2002 21:43:14 (kix 4.00 vs 2.29e) ; ;Informative KIXSTRIP: input=167 output=167 skip=0 ; ;Warning KIXSTRIP: 2 errors in block structure(s). missing statement(s). ; - do:until [0:0] ; - for|each:in|to:step|next [0|0:0|0:0|0] ; - function:endfunction [0:0] ; -ERROR- - if:else:endif [26:4:24] ; - select:case:endselect [0:0:0] ; - while:loop [0:0] ;Warning KIXSTRIP: some lines contains errors or possible errors. ;Informative KIXSTRIP: 26 block_structures found. ;Informative KIXSTRIP: no UDF's found. ;Informative KIXSTRIP: no labels found. ;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE ;Informative KIXSTRIP: 1 BREAK ;Informative KIXSTRIP: 1 SHELL ;Informative KIXSTRIP: 13 SLEEP ;Informative KIXSTRIP: 29 USE ; ;($end) ;($begin) ; ; ;($end)
And the code:
code:
IF INGROUP("Domain Admins") ? "Member of Domain Admins group"
USE G: /delete /persistent USE G: "\\ATC-CORP\VOL2" USE L: /delete /persistent USE L: "\\TK2\TRAKKER" IF Exist ("c:\windows\\DESKTOP\TRAKKE~1.PIF") = 0 IF Exist ("c:\windows\\DESKTOP\TRAKKE~2.PIF") = 0 IF Exist ("c:\windows\\DESKTOP\ESCROW~1.PIF") = 0 IF Exist ("c:\windows\\DESKTOP\REOESC~1.PIF") = 0 IF Exist ("c:\windows\\DESKTOP\STARDO~1.PIF") = 0
COPY "\\W2K2\netlogon\TRAKKE~1.PIF" "c:\windows\desktop" ;copies Trakker Star shortcut to desktop COPY "\\W2K2\netlogon\TRAKKE~2.PIF" "c:\windows\desktop" ;copies Trakker Lend shortcut to desktop COPY "\\W2K2\netlogon\ESCROW~1.PIF" "c:\windows\desktop" ;copies Escrow Docnet shortcut to desktop COPY "\\W2K2\netlogon\REOESC~1.PIF" "c:\windows\desktop" ;copies Reo Escrow Docnet shortcut to desktop COPY "\\W2K2\netlogon\STARDO~1.PIF" "c:\windows\desktop" ;copies Star Docnet shortcut to desktop ENDIF ENDIF ENDIF ENDIF ENDIF SLEEP 10
IF INGROUP("Everyone") ? "Member of Everyone group" IF Exist ("c:\windows\RD*") = 0 COPY "\\W2K2\netlogon\RD.BAT" "c:\windows" COPY "\\W2K2\netlogon\RD.PIF" "c:\windows" IF Exist ("c:\windows\MSTS*") = 0 COPY "\\W2K2\netlogon\MSTSC.EXE" "c:\windows" IF Exist ("c:\windows\MSTSCAX.DLL") = 0 COPY "\\W2K2\netlogon\MSTSCAX.DLL" "c:\windows" ENDIF ENDIF ENDIF SLEEP 3
The others have mentioned: each IF ** must ** have a corresponding ENDIF.
So, if the ENDIF s are added, we get the following: quote:
;($begin) ; ; thu 14-nov-2002 21:52:07 (kix 4.00 vs 2.29e) ; ;Informative KIXSTRIP: no errors found (input=169 output=169 skip=0). ; ;Summary KIXSTRIP: block structures ; - do:until [0:0] ; - for|each:in|to:step|next [0|0:0|0:0|0] ; - function:endfunction [0:0] ; - if:else:endif [26:4:26] ; - select:case:endselect [0:0:0] ; - while:loop [0:0] ;Informative KIXSTRIP: 26 block_structures found. ;Informative KIXSTRIP: no UDF's found. ;Informative KIXSTRIP: no labels found. ;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE ;Informative KIXSTRIP: 1 BREAK ;Informative KIXSTRIP: 1 SHELL ;Informative KIXSTRIP: 13 SLEEP ;Informative KIXSTRIP: 29 USE ; ;($end)
And the resulting code. Looks pretty huh?
code:
IF INGROUP("Domain Admins") ? "Member of Domain Admins group"
USE G: /delete /persistent USE G: "\\ATC-CORP\VOL2" USE L: /delete /persistent USE L: "\\TK2\TRAKKER" IF Exist ("c:\windows\\DESKTOP\TRAKKE~1.PIF") = 0 IF Exist ("c:\windows\\DESKTOP\TRAKKE~2.PIF") = 0 IF Exist ("c:\windows\\DESKTOP\ESCROW~1.PIF") = 0 IF Exist ("c:\windows\\DESKTOP\REOESC~1.PIF") = 0 IF Exist ("c:\windows\\DESKTOP\STARDO~1.PIF") = 0
COPY "\\W2K2\netlogon\TRAKKE~1.PIF" "c:\windows\desktop" ;copies Trakker Star shortcut to desktop COPY "\\W2K2\netlogon\TRAKKE~2.PIF" "c:\windows\desktop" ;copies Trakker Lend shortcut to desktop COPY "\\W2K2\netlogon\ESCROW~1.PIF" "c:\windows\desktop" ;copies Escrow Docnet shortcut to desktop COPY "\\W2K2\netlogon\REOESC~1.PIF" "c:\windows\desktop" ;copies Reo Escrow Docnet shortcut to desktop COPY "\\W2K2\netlogon\STARDO~1.PIF" "c:\windows\desktop" ;copies Star Docnet shortcut to desktop ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ; -- this is the first "fix" SLEEP 10
IF INGROUP("Everyone") ? "Member of Everyone group" IF Exist ("c:\windows\RD*") = 0 COPY "\\W2K2\netlogon\RD.BAT" "c:\windows" COPY "\\W2K2\netlogon\RD.PIF" "c:\windows" IF Exist ("c:\windows\MSTS*") = 0 COPY "\\W2K2\netlogon\MSTSC.EXE" "c:\windows" IF Exist ("c:\windows\MSTSCAX.DLL") = 0 COPY "\\W2K2\netlogon\MSTSCAX.DLL" "c:\windows" ENDIF ENDIF ENDIF ENDIF ; -- this is the second "fix" SLEEP 3
Note: The block structure of this. It makes it really easy to find and take care of issues with code.
Again, I would go and check out How do we check and format code for scripts.
Note the Batch file to process these through too.. Makes it pretty easy!!
HTH,
Kent
|
Top
|
|
|
|
#32486 - 2002-11-15 07:08 AM
Re: not mapping
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Steve,
One additional thing...
In your code you have (for example):
code:
IF Exist ("c:\windows\\DESKTOP\TRAKKE~1.PIF") = 0
Shouldn't this be:
code:
IF Exist ("c:\windows\DESKTOP\TRAKKE~1.PIF") = 0
Just noticed that one..
Kent
|
Top
|
|
|
|
#32489 - 2002-11-18 06:28 AM
Re: not mapping
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Steve..
You there?
Did any of our suggestions/help help you?
Kent
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 259 anonymous users online.
|
|
|