Page 2 of 2 <12
Topic Options
#32483 - 2002-11-15 05:12 AM Re: not mapping
Steve M Offline
Fresh Scripter

Registered: 2002-05-08
Posts: 40
Loc: Orange,California
I don't know exactly what you mean by nesting my IFs but yes the if ingroup("STAT") does not produce any results. I even did some tests by putting a user in multiple ESCROW-UNITs and just used a different drive letter and the script can see that user in all those groups and maps accordingly. I am really frustrated on why if that works why does the STAT ingroup do nothing?
[Eek!]
_________________________
Steve

Top
#32484 - 2002-11-15 05:31 AM Re: not mapping
Steve M Offline
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 Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#32486 - 2002-11-15 07:08 AM Re: not mapping
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#32487 - 2002-11-15 08:11 AM Re: not mapping
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
steve you are still missing the endif before:
if INGROUP("STAT")

I know you can get frustrated but, ain't that life...
_________________________
!

download KiXnet

Top
#32488 - 2002-11-15 02:54 PM Re: not mapping
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Steve: Please take a long hard look at the KiXtart Manual and notice the correct syntax for commads like IF-ENDIF, SELECT-CASE-ENDSELECT and so on. If you then start indenting your code you will notice very easily why your code doesn't work.

However, you code will require major rework anyway because the way you use the IFs is illogical, you don't want to have them nested at all.
_________________________
There are two types of vessels, submarines and targets.

Top
#32489 - 2002-11-18 06:28 AM Re: not mapping
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Steve..

You there?

Did any of our suggestions/help help you?

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#32490 - 2002-11-18 08:09 PM Re: not mapping
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I guess he's busy rewriting his code [Smile]
_________________________
There are two types of vessels, submarines and targets.

Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.062 seconds in which 0.028 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org