ter-pierre Posted October 7, 2004 Share Posted October 7, 2004 Hi I get the InGroup commenti´s function to use in my logon scripts, but this funtions uses the "net user" DOS command that dont run in Windows95 or 98 workstations (to say WORKSTATIONS for this is great!). any one knows another way to do? Link to comment Share on other sites More sharing options...
ter-pierre Posted October 8, 2004 Author Share Posted October 8, 2004 Ho God! I´m alone! Link to comment Share on other sites More sharing options...
normeus Posted October 9, 2004 Share Posted October 9, 2004 Il vostro commento descrive un problema relativo alle funzioni del sito???POST CODE or.... elaborate on the question. what is "InGroup""InGroup" = http://www.petri.co.il/ingroup.htm ? http://www.autoitscript.com/autoit3/scite/...iTe4AutoIt3.exe Link to comment Share on other sites More sharing options...
ter-pierre Posted October 11, 2004 Author Share Posted October 11, 2004 Excuse... :"> The "ingroup" UDF i download from this site. That is the code: --------------------------------------------------------------------------- Func InGroup($GROUP) $groupnamelength = StringLen ($group) If $groupnamelength > 21 Then $groupnamelength = 21 EndIf $groupnamearray = StringSplit ($GROUP,"") $group = "" For $groupcharactercount = 1 to $groupnamelength $group=$group & $groupnamearray[$groupcharactercount] Next ;Get the user details and pipe to a text file $tempfile = tempfile() RunWait(@ComSpec & " /c net user /Domain" & " " & @UserName & " >" & $tempfile, "", @SW_HIDE) ; Open textfile output from cmd net user $FILE = FileOpen($tempfile, 0) ; Check if file opened for reading OK If $FILE = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in file until the EOF is reached, if user is in group return 1 (true) or else 0 (false) While 1 $LINE = FileReadLine($FILE) & " " If @error = -1 Then FileClose($FILE) FileDelete($tempfile) ExitLoop EndIf If StringInStr($LINE, "*" & $GROUP & " ") Then FileClose($FILE) FileDelete($tempfile) Return 1 EndIf WEnd EndFunc ;==>InGroup ----------------------------------------------------------------------- Note that to know the groups that the user is member of, the function uses the "NET USER" command. This run fine in Windows2000 or XP workstations, but this command is not recognized by Windows95 or 98. Pierre Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now