Page 1 of 1 1
Topic Options
#164217 - 2006-07-12 10:49 PM ingroup() bug?
backermann Offline
Fresh Scripter

Registered: 2006-01-13
Posts: 6
First post here so sorry in advance for properness or lack there of..

Here's my problem: I run a login script for everyone in our company and and map a few drives based on groups. Simple
The first group (GRP_Jones-JI-APP-Hyperion) works fine with no problems (at least I haven't heard of any).
The second group (GRP_Jones_ScanDocs-Users) works on some but not others. All with the same os (Windows XP) and not too many differences. Haven't dug
too deep into the differences yet, but nothing obvious)
So on the ones that don't work, if fails here (If InGroup("GRP_Jones_ScanDocs-Users")) with a @SERROR of "The system cannot find the file specified."
Kixtart is ran of the server and called via a bat.
I'm currently using 4.22. I tried the latetest version and even the beta version with the same results.

Any ideas?


Code snippet below of the one that works and the one that works on some and not on others ******

***************************************************************************************

If InGroup("GRP_Jones-JI-APP-Hyperion")
If $Debug ? "========= Entering GRP_Jones-JI-APP-Hyperion Group =============" ? EndIf
If @ERROR <> 0
? "Error Checking Membership: " + @SERROR ?
Else
? ? "Connecting Drive P to \\NETWIN1\JONES\JI\APPS\Hyperion. . ."
If "$ForceMap" = "Y"
If $Debug ? "Use P: /Delete /Persistent" EndIf
Use "P:" /Delete /Persistent
EndIf
If $Debug ? "Use P: \\netwin1\hyperion$" EndIf
Use "P:" "\\netwin1\hyperion$"
$ResultCode = @Error
$ResultString = @SError

If $ResultCode = 0
? "The command completed successfully." ? ?
$ExitCode = $ExitSuccess
Else
Beep
? "System error "+$ResultCode+" has occurred."
?
? $ResultString
$=MessageBox("Failed to map the P Drive to \\netwin1\hyperion$" + Chr(13) + Chr(10) + "","Drive Mapping Failed!",48,5)
$ExitCode = $ResultCode
EndIf
EndIf
EndIf

If InGroup("GRP_Jones_ScanDocs-Users")
If $Debug ? "========= Entering GRP_Jones_ScanDocs-Users Group =============" ? EndIf
If @ERROR <> 0
? "Error Checking Membership: " + @SERROR ?
Else
? ? "Connecting Drive S to \\FTPSCAN\@USERID$. . ."
If "$ForceMap" = "Y"
If $Debug ? "Use S: /Delete /Persistent" EndIf
Use "S:" /Delete /Persistent
EndIf
If $Debug ? "Use S: \\FTPSCAN\@USERID$" EndIf
Use "S:" "\\FTPSCAN\@USERID$"
$ResultCode = @Error
$ResultString = @SError

If $ResultCode = 0
? "The command completed successfully." ? ?
$ExitCode = $ExitSuccess
Else
Beep
? "System error "+$ResultCode+" has occurred."
?
? $ResultString
$=MessageBox("Failed to map the S Drive to \\FTPSCAN\@USERID$" + Chr(13) + Chr(10) + "","Drive Mapping Failed!",48,5)
$ExitCode = $ResultCode
EndIf
EndIf
EndIf


Error message here

*****************************************************************************

========= Entering GRP_Jones_ScanDocs-Users Group =============
Error Checking Membership: The system cannot find the file specified.

Top
#164218 - 2006-07-12 11:05 PM Re: ingroup() bug?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
When it fails - are the any Kixtart messages in the application event log on the workstation it failed on ?
Top
#164219 - 2006-07-12 11:13 PM Re: ingroup() bug?
backermann Offline
Fresh Scripter

Registered: 2006-01-13
Posts: 6
Nope. No errors that I see
Top
#164220 - 2006-07-12 11:25 PM Re: ingroup() bug?
backermann Offline
Fresh Scripter

Registered: 2006-01-13
Posts: 6
BTW: I did try /f with no luck either
Top
#164221 - 2006-07-12 11:49 PM Re: ingroup() bug?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
There is no known bug with InGroup(). Without actually counting characters, maybe you simply exceeded the supported number. Try shorter names.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#164222 - 2006-07-13 05:00 PM Re: ingroup() bug?
backermann Offline
Fresh Scripter

Registered: 2006-01-13
Posts: 6
Well it works with other people (including myself), so I don't think it's a length issue..
Top
#164223 - 2006-07-13 07:00 PM Re: ingroup() bug?
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
If the groups work for you, have someone tht does not work logon to your computer. Does it work or fail on the other user on the same computer that worked for you? then if it works for you on your computer, try logging on to a coputer where that user fails. What are the results?

Edited by Howard Bullock (2006-07-13 07:01 PM)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#164224 - 2006-07-14 05:27 PM Re: ingroup() bug?
backermann Offline
Fresh Scripter

Registered: 2006-01-13
Posts: 6
Problem solved. No Bug, just bad code on my part..

Thanks Howard! You pointed me in the right direction. I'm embarrassed about this one.. Oops!

The results were: I logged into her machine with the same problem. She logged into my machine with the same problem.

The problem was an @Error was from a previous line. I guess the Ingroup() only throws a 1 or 0 and has nothing to do with the @Error?. Anywho, when I ran my Ingroup() with the @Error check, it failed if the previous @Error <> 0. My bad. I just removed the @Error checking from the Ingroup() lines and that fixed the problem.

Thanks for everyone’s help.

Brad

Top
#164225 - 2006-07-14 05:44 PM Re: ingroup() bug?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Ja, lemme guess... MessageBox() was throwing @Error? It bytes a lot of ppl.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#164226 - 2006-07-14 05:47 PM Re: ingroup() bug?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
BTW, if you had posted with code tags to preserve indenting, ppl may have scrutinized your code more closely.
_________________________
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 1 1


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

Who's Online
0 registered and 476 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

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

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