#35579 - 2003-01-23 04:52 PM
IF Ingroup ...USE X: Doesn't map drives in XP
|
tarnold
Fresh Scripter
Registered: 2003-01-23
Posts: 6
|
When using the command IF InGroup("example") /persistent Use J: $s+"\example" ENDIF
On WinXP machines this will not work, or intermittently. I'm using kix32.exe v4.02
|
|
Top
|
|
|
|
#35581 - 2003-01-23 07:51 PM
Re: IF Ingroup ...USE X: Doesn't map drives in XP
|
tarnold
Fresh Scripter
Registered: 2003-01-23
Posts: 6
|
Thanks for your reply. However, I don't believe it is a syntax problem. I tried the syntax suggested and it still doesn't work on some machines. I map fine on my xp machine (with either syntax " or '), however when I go to another machine it won't map any drive using the IF INGROUP ... USE ENDIF command. It will map drives using strictly the USE command.
thanks
|
|
Top
|
|
|
|
#35584 - 2003-01-24 01:00 AM
Re: IF Ingroup ...USE X: Doesn't map drives in XP
|
Clancy
Fresh Scripter
Registered: 2002-08-26
Posts: 14
Loc: Reno, NV
|
I've got the same script for 98, 2k, and XP machines in multiple locations, and my ingroup statements are perfectly fine... example:
code:
If InGroup ("@domain\RenoUsers") ; Tell the user what were up to $ProgressPrompt = "Connecting Reno, NV..." Gosub DRAW_PROGRESS ; Connect up some drives Use G: "\\RENO_NT3\E" Use H: "\\RENO_NT3\F" Use S: "\\RENO_NT3\I" Run "\\RENO_NT3\EZAUDIT\ezscan.exe auto" Endif
[ 28. January 2003, 23:47: Message edited by: Clancy ]
|
|
Top
|
|
|
|
#35585 - 2003-01-24 07:57 AM
Re: IF Ingroup ...USE X: Doesn't map drives in XP
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Clancy..
Remember, every IF ** MUST ** be terminated with an ENDIF.
I would go back and follow the suggestions of @error and debugging your code.
Kent [ 24. January 2003, 07:58: Message edited by: kdyer ]
|
|
Top
|
|
|
|
#35586 - 2003-01-25 04:25 AM
Re: IF Ingroup ...USE X: Doesn't map drives in XP
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
Incorrect syntax between IF/ENDIF structure doesn't mean your script will never run in a correct way.
We suggest something like
code:
IF (Ingroup("example") <> 0) USE J: /delete /persistent USE J: "$s\example" IF (@error <> 0) ? "Error KIX-USE: problems during mapping. code @error (@serror)" ENDIF ENDIF
greetings.
|
|
Top
|
|
|
|
#35587 - 2003-01-28 11:43 PM
Re: IF Ingroup ...USE X: Doesn't map drives in XP
|
Clancy
Fresh Scripter
Registered: 2002-08-26
Posts: 14
Loc: Reno, NV
|
Sorry Kdyer, my cut and paste didn't include the Endif, but there's definately one there in my script. Not enought coffee before my post!
I edited my post accordingly, sorry for the delay in that one. [ 28. January 2003, 23:47: Message edited by: Clancy ]
|
|
Top
|
|
|
|
#35589 - 2003-01-29 08:21 PM
Re: IF Ingroup ...USE X: Doesn't map drives in XP
|
tarnold
Fresh Scripter
Registered: 2003-01-23
Posts: 6
|
I'm still experiencing the problem. It appears on my XP box - when i execute the scripts it maps drives as it should. However, when i go to another machine anything in the "Ingroup" section doesn't map.
Here's the complete script - any help would be appreciated.
CLS
Color c+/w BOX (0,0,24,79,GRID) ; 'background grid' Color c/w BOX (7,11,21,71,Å) ; 'shadow' of the box Color c+/w BOX (6,10,20,70,FULL)
Color n+/w AT ( 7,20) "Userid : " ; display some text strings AT ( 9,20) "Full name : " AT (10,20) "Privilege : " AT (11,20) "Workstation : " AT (12,20) "Domain : " AT (13,20) "Logon Server : "
Color n+/w AT ( 7,40) @userid ; ...and some macro's AT ( 9,35) @fullname AT (10,35) @priv AT (11,35) @wksta AT (12,35) @domain AT (13,35) @lserver at (16,20) "Welcome To The xxxxx Network !" at (17,20) "Today Is "+@date at (18,20) "Unauthorized Access is Prohibited"
sleep 3 Color w+/n
; Map drives here use F: $home use G: "\\ntmain\sys" use M: "$s\mail" use W: "$s\shardata"
debug on
IF INGROUP("MORTGAGE_GROUP") use N: "$s\MTG" ENDIF
IF INGROUP("FINANCE") use I: "$s\FINANCE" ENDIF
IF INGROUP("2NDFLRSEC") use I: "$s\SECRETAR" use lpt2 "$s\2ndFLsec" ENDIF
IF INGROUP ("MTGDATA") use L: "$s\MORTGAGE" ENDIF
IF INGROUP ("COMMERCIAL_LOANS") use H: "$s\COMMERCI" ENDIF
IF INGROUP ("DEPOSIT_ADM") use H: "$s\DEPOSADM" ENDIF
IF INGROUP ("LOANSERV") use H: "$s\LOANSERV" ENDIF
IF INGROUP ("BRNCHMGT") use J: "$s\BRNCHMGT" ENDIF
IF INGROUP ("1STFLOOR") use H: "$s\1STFLOOR" ENDIF
IF INGROUP ("INFOSYS") Use J: "$s\INFOSYS" ENDIF
IF INGROUP ("AUDIT") use H: "$s\AUDIT" ENDIF
IF INGROUP ("INVESTMENT") use H: "$s\INVESTMT" ENDIF
IF INGROUP ("HUMAN_RESOURCES") use L: "$s\HR" ENDIF
IF INGROUP ("Consumer") use O: "$s\Consumer" ENDIF
IF INGROUP ("DepAdm") use o: "$s\depadm" ENDIF
IF INGROUP ("Compliance") use J: "$s\Compliance" ENDIF
IF INGROUP ("Comscan") use k: /delete /persistent use k: "$s\comscan" IF (@error <>0) ? "Error Kix-user: problems during mapping. code @error (@error)" ENDIF ENDIF
EXIT [ 29. January 2003, 22:03: Message edited by: tarnold ]
|
|
Top
|
|
|
|
#35592 - 2003-01-29 08:51 PM
Re: IF Ingroup ...USE X: Doesn't map drives in XP
|
tarnold
Fresh Scripter
Registered: 2003-01-23
Posts: 6
|
I did define it, just didn't copy it by mistake. Sorry.
; Assign variables for user directory and group drives $s=\\ntmain $u=@USERID $home=$s+"\"+$u+"$"
|
|
Top
|
|
|
|
#35594 - 2003-01-29 09:09 PM
Re: IF Ingroup ...USE X: Doesn't map drives in XP
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
tarnold,
Looking through your code..
You need to surround with quotes:
$s=\\ntmain
to be -
$s="\\ntmain"
Try that..
Kent
|
|
Top
|
|
|
|
#35595 - 2003-01-29 10:01 PM
Re: IF Ingroup ...USE X: Doesn't map drives in XP
|
tarnold
Fresh Scripter
Registered: 2003-01-23
Posts: 6
|
I've turned on debug and used @error var. and nothing comes up. The drives can be mapped by using the net use command at a dos prompt.
|
|
Top
|
|
|
|
#35597 - 2003-01-29 10:17 PM
Re: IF Ingroup ...USE X: Doesn't map drives in XP
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
tarnold,
You have the right idea.. Try this..
With your USE statements use a UDF (User-Defined Function).
For example:
code:
; -- User presentation display code above
$s = "\\ntmain" ; -- surrounded with quotes $home = "\\ntmain\home" ; - assumed
; Map drives here DRVMAP("F:",$home) DRVMAP("G:","\\ntmain\sys") DRVMAP("M:",$s+"\mail") DRVMAP("W:",$s+"\shardata")
DEBUG ON
IF INGROUP("MORTGAGE_GROUP") DRVMAP("N:",$s+"\MTG") ENDIF ; -- Other groups
FUNCTION DRVMAP($drv,$share) IF EXIST($drv) USE $drv /DELETE /PERSISTENT ENDIF USE $drv $share IF (@error <>0) ? "Error Kix-user: problems during mapping. code (@error) while mapping $drv on $share" SLEEP 3 ENDIF ENDFUNCTION
HTH,
Kent
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 837 anonymous users online.
|
|
|