'+-----------------------------------------------------------------------------------+ '| Header: Bestimmen der bergabeparameter | '| AnzeigeCheck:|Il1 sind Alt-0124, Groes i, kleines L, Eins ߎę֚| Const Autor="NetLg.Bas v0.23.0 2012 by ytwinky, MD"' | '| (Tastenkombination: keine) | '| | '| Zweck : Schablone fr neue Dateien | '+-----------------------------------------------------------------------------------+ '(Anmerkung zu den Sonderzeichen: zuerst steht das DOS-Zeichen, danach das Windowszeichen) Const Lf=!"\n", Esc=!"\27", Cr=!"\13" Declare Function Replace(byVal Text As String, byVal Suche As String, byVal ErsetzeMit As String) As String Declare Function MenuChar(s As String, First As Integer=1, nVG As Integer=8+4)As String Declare Function GetChar(s As String, UpCase As Byte=1=0) As String 'returns a single char Dim As Integer i, j, m=0, EingabeDatei=FreeFile, zeile, spalte, umax=0 Dim As String s, Msg, NetLg(1 To 20), ac, mc Open Pipe "Net LocalGroup" For Input As #EingabeDatei While Not Eof(EingabeDatei) Input #EingabeDatei, s If s<>"" And Instr(s, "*") Then m+=1 ac &= Str(m) NetLg(m)=Str(m) &" " & Mid(s, 2) EndIf Wend Close EingabeDatei Print Autor &!"\nVohandene Gruppen:" For i=1 To m Print MenuChar(NetLg(i)) Next Zeile=CsrLin Spalte=Pos() Do Do Locate Zeile, Spalte mc=GetChar(!"Von welcher Gruppe die Mitglieder anzeigen? \b") Loop Until InStr(ac & Esc &"x", mc) Print mc If umax Then Locate Zeile+1, 1 For i=1 To umax+1 Print String(60, " ") Next umax=0 Locate Zeile+1, 1 EndIf Select Case lcase(mc) Case Esc, "x" : End Case Else mc=Mid(NetLg(ValInt(mc)), 3) j=0 Print "Mitglieder von " & mc &":" If InStr(mc, "") Then mc = Replace(mc, "", "") 'Ooops, was ist denn das???^^^^ Open Pipe "Net LocalGroup " & mc For Input As #EingabeDatei While Not Eof(EingabeDatei) Line Input #EingabeDatei, s If j=0 Then j=InStr(s, "--") If j Then If (InStr(s, "--")=0 And InStr(s, ".")=0 And s<>"") Then Print s umax+=1 EndIf EndIf Wend Close EingabeDatei End Select Loop Until mc=Esc Function Replace(byVal Text As String, byVal Suche As String, byVal ErsetzeMit As String) As String Dim i As Integer, s As String=Text While Instr(s, Suche) i=Instr(s, Suche) s=Left(s, i-1) &ErsetzeMit &Mid(s, i+Len(Suche)) Wend Return s End Function Function MenuChar(s As String, First As Integer=1, nVG As Integer=8+4)As String Var cVG=LoWord(Color), cHG=HiWord(Color) If First<>1 Then Print Left(s, First-1); Color nVG Print Chr(s[First-1]); Color cVG Return Mid(s, First+1) End Function Function GetChar(s As String, UpCase As Byte=1=0) As String 'returns a single char '2008 by ytwinky, MD Var m="" 'it is always a good habit to declare variables, we are going to use.. If s<>"" Then Print s; 'show inputprompt, if any.. Do Do m=InKey Sleep 1 Loop Until m<>"" And Len(m)=1 'ignore FunKeys and NoKeys Loop Until m[0]>31 And m[0]<256 Or Instr(Cr & Esc, m) 'm is printable or cr or esc If UpCase Then Return UCase(m) 'convert if desired Return m ' just m only End Function ' done..