#164217 - 2006-07-12 10:49 PM
ingroup() bug?
|
backermann
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
|
|
|
|
#164219 - 2006-07-12 11:13 PM
Re: ingroup() bug?
|
backermann
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
Fresh Scripter
Registered: 2006-01-13
Posts: 6
|
BTW: I did try /f with no luck either
|
|
Top
|
|
|
|
#164222 - 2006-07-13 05:00 PM
Re: ingroup() bug?
|
backermann
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
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)
|
|
Top
|
|
|
|
#164224 - 2006-07-14 05:27 PM
Re: ingroup() bug?
|
backermann
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
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1376 anonymous users online.
|
|
|