Page 1 of 2 12>
Topic Options
#35579 - 2003-01-23 04:52 PM IF Ingroup ...USE X: Doesn't map drives in XP
tarnold Offline
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
#35580 - 2003-01-23 05:13 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please read the KiXtart Manual for correct syntax and ways to debug scripts!
code:
IF InGroup('example')
Use J: $s+'/example' /persistent
ENDIF

_________________________
There are two types of vessels, submarines and targets.

Top
#35581 - 2003-01-23 07:51 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
tarnold Offline
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
#35582 - 2003-01-23 07:54 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The do some serious debugging by using DEBUG ON and make liberal use of the @ERROR macro. Or post the complete script as the snipped you posted DID contain incorrect code.
_________________________
There are two types of vessels, submarines and targets.

Top
#35583 - 2003-01-23 07:56 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Put in some error messages. Also, maybe you might explain the situation. Does it work or not work on xp? What exactly is the difference between the 2 scenarios.

[ 23. January 2003, 19:57: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#35584 - 2003-01-24 01:00 AM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Clancy Offline
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 Offline
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 ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#35586 - 2003-01-25 04:25 AM Re: IF Ingroup ...USE X: Doesn't map drives in XP
MCA Offline
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.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#35587 - 2003-01-28 11:43 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Clancy Offline
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! [Roll Eyes]

I edited my post accordingly, sorry for the delay in that one.

[ 28. January 2003, 23:47: Message edited by: Clancy ]

Top
#35588 - 2003-01-28 11:58 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
clancy, you might want to paste your whole code if it's not too huge.
_________________________
!

download KiXnet

Top
#35589 - 2003-01-29 08:21 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
tarnold Offline
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
#35590 - 2003-01-29 08:28 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You never define the variable $s!

And please post code in between [CODE] tags as described in ABC's of KiXtart board etiquette and message to new forum users.
_________________________
There are two types of vessels, submarines and targets.

Top
#35591 - 2003-01-29 08:31 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Are you running XP Pro? Have you renamed the computer?
Try deleting the reg key:
HKEY_CURRENT_USER\Software\KiXtart\TokenCache
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#35592 - 2003-01-29 08:51 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
tarnold Offline
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
#35593 - 2003-01-29 09:01 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Okay, I'm asking again!
Did you do some debugging?
Did you check the @ERROR levels for the INGROUPs that fail? What are they?
Did you check the @ERROR levels for the USE statements that fail? What are they?
Did you check the actual content of each variable by utilizing DEBUG ON?
Have you tried a simple test script with just one drive mapping and the with just a simple INGROUP?
Does it work from the command line?
_________________________
There are two types of vessels, submarines and targets.

Top
#35594 - 2003-01-29 09:09 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#35595 - 2003-01-29 10:01 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
tarnold Offline
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
#35596 - 2003-01-29 10:07 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Jeez, you should really learn to give complete answers and provide as much DETAIL as possible.

If you run a script with DEBUG ON then there should be debugging commands available in the first line of the console. If nothing comes up then it indicats that the script did not run at all.

How do you call the script? As I said earlier, try with a smaller script and expand piece-by-piece.
_________________________
There are two types of vessels, submarines and targets.

Top
#35597 - 2003-01-29 10:17 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#35598 - 2003-01-29 10:23 PM Re: IF Ingroup ...USE X: Doesn't map drives in XP
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well, if tarnold is to be believed, the problem is not with the mapping but rather with InGroup().

One therefore needs to focus their attention on why InGroup() fails.

Kent,
I fail to see where your UDF has anything to do with the InGroup() issue.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 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 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.077 seconds in which 0.032 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