Page 1 of 1 1
Topic Options
#195975 - 2009-09-21 03:16 PM logon script processing issues
metatron Offline
Fresh Scripter

Registered: 2008-05-06
Posts: 27
Loc: london
every group in our company has a mapping to a mailarch drive containing old pst etc.

i use this to map to it

Use N: "$ARCHIVE\Mailarchs\@USERID"

if a user doesnt have a folder there it slows down the whole thing wihile kix looks for a non existant entry. how do i insert an IF to check if the user has a folder in this location before processing the use command? i have other drives mappings as well above and below so the script needs to carry on even if there is no N drive folder for the user. hope this makes sense

thanks

Top
#195976 - 2009-09-21 03:26 PM Re: logon script processing issues [Re: metatron]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
As long as $ARCHIVE is valid it shouldn't slow down significantly at all - it should fail very quickly with a 53 path not found error *unless* the archival system is doing something very clever in the background and creating pseudo-directory views on the fly.

If $ARCHIVE is missing or set to an invalid path then the stack can take quite a long time trying to resolve the bad name.

If it is the archival system causing the problem then you are out of luck as the check for the folder will cause the same slow down as the folder mapping would anyway.

Top
#195979 - 2009-09-21 05:00 PM Re: logon script processing issues [Re: Richard H.]
metatron Offline
Fresh Scripter

Registered: 2008-05-06
Posts: 27
Loc: london
$Archive isnt anything fancy just saves me from typing long UNCs every time. the problem is the @userID bit. not all users have folders here so the ones that dont get a slow logon file the ones that do get a quick one.
Top
#195980 - 2009-09-21 05:05 PM Re: logon script processing issues [Re: metatron]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
A simple workaround/solution.

 Code:
If Exist($ARCHIVE + "\Mailarchs\" + @USERID)
	Use N: $ARCHIVE + "\Mailarchs\" + @USERID
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#195982 - 2009-09-21 06:19 PM Re: logon script processing issues [Re: Mart]
metatron Offline
Fresh Scripter

Registered: 2008-05-06
Posts: 27
Loc: london
cool thanks mart.
Top
#195983 - 2009-09-21 06:33 PM Re: logon script processing issues [Re: metatron]
metatron Offline
Fresh Scripter

Registered: 2008-05-06
Posts: 27
Loc: london
:IT
At (8,13) "IT script running"
Use J: "$IT\JOB"
If Exist($ARCHIVE + "\ITS-Mailarchs\" + @USERID)
Use M: $ARCHIVE + "\ITS-Mailarchs\" + @USERID
Use P: "$DEFAULT\PRODOS"
Use T: "$SCANS\IT"
If InGroup( "ITN\Service Desk" )
Goto Set_Home_Page
EndIf
Goto "preend"

ok so this is what i have now. do i need the endif still? it exits the script at the end of the m drive map. this is not what i wanted.

Top
#195986 - 2009-09-21 07:36 PM Re: logon script processing issues [Re: metatron]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
2 problems that I see:
1. You're missing an EndIf
2. You use GOTOs

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#195987 - 2009-09-21 07:44 PM Re: logon script processing issues [Re: Glenn Barnas]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
 Code:
:IT
At (8,13) "IT script running"
Use J: "$IT\JOB"
If Exist($ARCHIVE + "\ITS-Mailarchs\" + @USERID)
  Use M: $ARCHIVE + "\ITS-Mailarchs\" + @USERID
  Use P: "$DEFAULT\PRODOS"
  Use T: "$SCANS\IT"
  If InGroup( "ITN\Service Desk" )
    Goto Set_Home_Page
  EndIf
  Goto "preend"
EndIf

Instead of using Goto, consider making the sections you point into functions, and that way eliminating the need of Goto.

Top
#196013 - 2009-09-22 01:22 PM Re: logon script processing issues [Re: Arend_]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Also with gotos, I find it is often you have:
 Code:
if some_condition goto my_label
run some code
:my_label
general code
where the code after the goto falls into the label. To get rid of the goto, negate the logic:
 Code:
if not some_condition
   run some code
endif
general code
gives you the same result and no gotos.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.074 seconds in which 0.039 seconds were spent on a total of 13 queries. Zlib compression enabled.

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