1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. GtaSpider

Beiträge von GtaSpider

  • Mehrere Befehle zusammenfassen

    • GtaSpider
    • 5. September 2006 um 17:52

    Hallo!

    Meinst du sowas?
    schnell im explorer gemacht also ohne scite und somit auch untested ;)

    [autoit]


    funktion()

    [/autoit][autoit][/autoit][autoit]

    Func funktion()
    MsgBox(0,"","Freu :)")
    funktion2()
    funktion3()
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func funktion2()
    MsgBox(0,"","Freu2 :)")
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func funktion3()
    MsgBox(0,"","Freu3 :)")
    EndFunc

    [/autoit]
  • Funktion schreiben

    • GtaSpider
    • 5. September 2006 um 17:36

    Hallo!

    Genau ;) wollte nur ein bsp einsetzen damit das jeder austesten/verstehen kann!

    Mfg Spider

  • Neue AutoIT-Beta

    • GtaSpider
    • 5. September 2006 um 17:15

    Hallo!

    Falls du scite meinst, dann lade dir die neue version von scite Hier

    Mfg Spider

  • Funktion schreiben

    • GtaSpider
    • 5. September 2006 um 17:12

    Hallo!

    Guck mal im Galenda.. Da gibt es schon soeine funktion:

    Spoiler anzeigen
    [autoit]

    ;===============================================================================
    ;
    ; Description: Verknüpft Dateierweiterung mit Anwendung
    ; Parameter(s): $sFileType = Dateierweiterung
    ; $sDescription = Beschreibung für die Datei
    ; (optional) $sAppName = Anwendung für die Registriert werden
    ; soll, wird keine Anwendung angegeben
    ; wird die aktuelle Anwendung eingetragen
    ; Requirement(s): keine
    ; Return Value(s): bei Erfolg: 1
    ; bei Fehler: 0 und @error = 1
    ; Author(s): bernd670
    ;
    ;===============================================================================
    Func _RegisterFileType($sFileType, $sDescription, $sAppName = "")
    Dim $sTypeName

    If $sFileType = "" Or $sDescription = "" Then
    SetError(1)
    Return 0
    EndIf

    If $sAppName = "" Then $sAppName = @ScriptFullPath

    $sFileType = StringLower($sFileType)

    If StringLeft($sFileType, 1) <> "." Then
    $sTypeName = $sFileType
    $sFileType = "." & $sFileType
    Else
    $sTypeName = StringRight($sFileType, StringLen($sFileType) - 1)
    EndIf

    $sTypeName = $sTypeName & "file"

    RegWrite("HKCR" & $sFileType, "", "REG_SZ", $sTypeName)
    RegWrite("HKCR" & $sTypeName, "", "REG_SZ", $sDescription)
    RegWrite("HKCR" & $sTypeName & "shellopencommand", "", "REG_SZ", $sAppName & " -cal %1")
    RegWrite("HKCR" & $sTypeName & "DefaultIcon", "", "REG_SZ", $sAppName & ",0")

    SetError(0)
    Return 1
    EndFunc ;==>_RegisterFileType

    [/autoit]

    Mfg Spider

  • ftp.au3

    • GtaSpider
    • 4. September 2006 um 20:44

    Hallo!

    aha... dann suchmal in der egnl forum suche nach "FTP"..

    Mfg Spider

  • Eigene Funktionen

    • GtaSpider
    • 4. September 2006 um 20:33

    Dann Schreib das auch hin!!!!!

    Zumindestens sowas wie "Thx to Wouter and Spider" oder sowas und schrieb nicht "Eigene Version" X(

    Spider!

  • ftp.au3

    • GtaSpider
    • 4. September 2006 um 20:32

    http://www.autoitscript.com/forum/index.php?act=Attach&type=post&id=3314

  • Eigene Funktionen

    • GtaSpider
    • 4. September 2006 um 20:28

    Hallo!

    Das glaube ich dir nicht!
    Deine Funktion:

    Spoiler anzeigen
    Code
    ;===============================================================================
    ;
    ; Function Name:    _FTPPutDir()
    ; Description:      Puts an dir on an FTP server.
    ; Parameter(s):     $l_FTPSession       - The Long from _FTPConnect()
    ;                   $s_LocalDir         - The local directory.
    ;                   $s_RemoteDir        - The remote Location for the directory.
    ;                   $l_Flags        - Special flags.
    ;                   $l_Context          - I dont got a clue what this does.
    ; Requirement(s):   DllCall, wininet.dll
    ; Return Value(s):  On Success - 1
    ;                   On Failure - 0
    ; Author(s):        Manuel Kübler <mk-software@gmx.de>
    ;
    ;===============================================================================
    
    
    Func _FTPPutDir($l_FTPSession, $s_LocalDir, $s_RemoteDir, $l_Flags = 0, $l_Context = 0)
    
    
            Local $ai_FTPPutDir = DllCall('wininet.dll', 'int', 'FtpPutDirectory', 'long', $l_FTPSession, 'str', $s_LocalDir, 'str', $s_RemoteDir, 'long', $l_Flags, 'long', $l_Context)
            If @error OR $ai_FTPPutDir[0] = 0 Then
                    SetError(-1)
                    Return 0
            EndIf
    
            Return $ai_FTPPutDir[0]
    
    EndFunc   ;==> _FTPPutDir
    Alles anzeigen


    Die version von Wouter:

    Spoiler anzeigen
    Code
    ;===============================================================================
    ;
    ; Function Name:    _FTPMakeDir()
    ; Description:      Makes an Directory on an FTP server.
    ; Parameter(s):     $l_FTPSession	- The Long from _FTPConnect()
    ;                   $s_Remote 		- The file name to be deleted.
    ; Requirement(s):   DllCall, wininet.dll
    ; Return Value(s):  On Success - 1
    ;                   On Failure - 0
    ; Author(s):        Wouter van Kesteren
    ;
    ;===============================================================================
    
    
    Func _FTPMakeDir($l_FTPSession, $s_Remote)
    
    	Local $ai_FTPMakeDir = DllCall('wininet.dll', 'int', 'FtpCreateDirectory', 'long', $l_FTPSession, 'str', $s_Remote)
    	If @error OR $ai_FTPMakeDir[0] = 0 Then
    		SetError(-1)
    		Return 0
    	EndIf
    
    	Return $ai_FTPMakeDir[0]
    
    EndFunc ;==> _FTPMakeDir()
    Alles anzeigen

    Ich finde die haben eine sehr extreme änlichkeit!

    Und die Mail funktion hast du einfach einbisschen abgespackt!

    Wenn du schon was "böses" machst dann steh zumindestens auch dazu!

    Mfg Spider

  • Eigene Funktionen

    • GtaSpider
    • 4. September 2006 um 20:20

    Hallo dj!

    *hust* Die email funktion hab ich geschrieben und die FTP Putfile hat auch jmd anders geschrieben!

    Ich hoffe das ich das nicht noch einmal von dir sehen muss!

    Mfg Spider

  • GUICtrlCreateListView scrollt falsch

    • GtaSpider
    • 4. September 2006 um 14:57

    Hallo!

    Genau das problem hatte ich auchmal :stolz_bin:

    Hab einfach GuiCtrlCreateList genommen =) Vlt hilft dir das ja auch weiter ;)

    Mfg Spider

  • Wie markiertes Item aus einer GuiCtrlList löschen?

    • GtaSpider
    • 3. September 2006 um 15:30

    Hallo!

    Wenn überhaupt GuiCtrlRead(GuiCtrlRead($liste)) ! und so auch nur den text!Ist ja kein ListView!

    Mfg spider

  • ComboSearch

    • GtaSpider
    • 3. September 2006 um 15:26

    Hallo!

    Mich nervt es dsa man bei _GuiCtrlComboFindString nicht ein sting in der mitte suchen kann! Also hab ich ne funktion geschrieben und wolte sie euch nicht vohrenthalten :tier:

    Code
    Func _ComboSearch($combo,$search,$startin = 0)
    	For $i = $startin To _GUICtrlComboGetCount($combo)
    		$text = ""
    		_GUICtrlComboGetLBText($combo,$i,$text)
    		If StringInStr($text,$search) Then Return $i
    	Next
    	Return -1
    EndFunc


    Und hier mal in dem Scriptomatic (WMI) tool von SvenP:

    Spoiler anzeigen
    C
    ; AutoIt ScriptOMatic
    ; -------------------
    ;
    ; AutoIt's counterpart of Microsoft's Scriptomatic
    ;
    ; Author:		SvenP
    ; Date/version:	2005-04-17
    ; See also:		http://www.microsoft.com/technet/scriptcenter/tools/scripto2.mspx
    ; Requires:		AutoIt beta version 3.1.1.8 or higher (COM support!!)
    ;
    ; GUI generated by AutoBuilder 0.5 Prototype
    
    
    #include <GuiConstants.au3>
    #include <GuiCombo.au3>
    
    
    ;************************
    ;* Global State Variables
    ;************************
    $g_strCurrentNamespace = "\root\CIMV2"
    $g_iCurrentNamespaceIndex = 0
    $g_strWMISource = "localhost"
    $g_strOutputFormat = "Dialog"
    $oldread = ""
    $oldindex = 0
    
    
    ;************************
    ;* Main GUI
    ;************************
    
    
    GUICreate("AutoIt Scriptomatic Tool", 684, 561, (@DesktopWidth - 684) / 2, (@DesktopHeight - 561) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
    
    
    $GUI_AST_MainGroup = GUICtrlCreateGroup("", 10, 10, 660, 530)
    $GUI_WMI_NamespaceLabel = GUICtrlCreateLabel("WMI Namespace", 20, 30, 150, 20)
    $GUI_WMI_Namespace = GUICtrlCreateCombo("WMI_Namespaces", 20, 50, 280, 80)
    $GUI_WMI_ClassLabel = GUICtrlCreateLabel("WMI Class", 320, 30, 100, 20)
    $GUI_WMI_SearchInp = GUICtrlCreateInput("Suche", 380, 30, 180, 20)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $GUI_WMI_SearchBut = GUICtrlCreateButton("Suche", 380+185, 30, 50, 20)
    $GUI_WMI_Classes = GUICtrlCreateCombo("WMI_Classes", 320, 50, 340, 80)
    $GUI_AST_ButtonGroup = GUICtrlCreateGroup("", 10, 80, 660, 50)
    $GUI_AST_Run = GUICtrlCreateButton("Run", 20, 100, 50, 20)
    $GUI_AST_CIMv2 = GUICtrlCreateButton("CIMv2", 80, 100, 50, 20)
    $GUI_AST_WMISource = GUICtrlCreateButton("WMISource", 140, 100, 70, 20)
    $GUI_AST_Open = GUICtrlCreateButton("Open", 220, 100, 60, 20)
    $GUI_AST_Save = GUICtrlCreateButton("Save", 290, 100, 60, 20)
    $GUI_AST_Quit = GUICtrlCreateButton("Quit", 360, 100, 60, 20)
    $GUI_AST_OptionGroup = GUICtrlCreateGroup("Output", 430, 80, 240, 50)
    $GUI_AST_RadioDialog = GUICtrlCreateRadio("Dialog", 440, 100, 50, 20)
    $GUI_AST_RadioText = GUICtrlCreateRadio("Text", 510, 100, 50, 20)
    $GUI_AST_RadioHTML = GUICtrlCreateRadio("HTML", 570, 100, 50, 20)
    $GUI_AST_ScriptCode = GUICtrlCreateEdit("One moment...", 20, 140, 640, 390)
    
    
    GUISetState()
    
    
    ; Initial GUI Settings
    GUICtrlSetState($GUI_AST_Run, $GUI_DISABLE)
    GUICtrlSetState($GUI_AST_Save, $GUI_DISABLE)
    GUICtrlSetState($GUI_AST_RadioDialog, $GUI_CHECKED)
    
    
    ; Fill the WMI_Namespaces Combobox
    LoadWMINamespaces()
    
    
    ; Fill the WMI_Classes Combobox
    HandleNamespaceChange()
    
    
    GUICtrlSetState($GUI_WMI_SearchInp, $GUI_ENABLE)
    GUICtrlSetState($GUI_AST_Run, $GUI_enABLE)
    GUICtrlSetState($GUI_AST_Save, $GUI_ENABLE)
    ;~ GUICtrlSetState($GUI_AST_RadioDialog, $GUI_CHECKED)
    
    
    
    
    While 1
    	$msg = GUIGetMsg()
    	Select
    		Case $msg = $GUI_WMI_SearchBut
    			$read = GuiCtrlRead($GUI_WMI_SearchInp)
    			If $read = $oldread Then
    				$oldread = $read
    				$oldindex = _ComboSearch($GUI_WMI_Classes,$read,$oldindex+1)
    			Else
    				$oldread = $read
    				$oldindex = _ComboSearch($GUI_WMI_Classes,$read)
    			EndIf
    			_GUICtrlComboSetCurSel($GUI_WMI_Classes,$oldindex)
    		Case $msg = $GUI_EVENT_CLOSE
    			ExitLoop
    		Case $msg = $GUI_AST_Quit
    			ExitLoop
    		Case $msg = $GUI_WMI_Namespace
    			HandleNamespaceChange()
    		Case $msg = $GUI_WMI_Classes
    			ComposeCode()
    		Case $msg = $GUI_AST_Run
    			RunScript()
    		Case $msg = $GUI_AST_Save
    			SaveScript()
    		Case $msg = $GUI_AST_Open
    			OpenScript()
    		Case $msg = $GUI_AST_CIMv2
    			SetNamespaceToCIMV2()
    		Case $msg = $GUI_AST_WMISource
    			SetWMIRepository()
    		Case $msg = $GUI_AST_RadioDialog Or _
    				$msg = $GUI_AST_RadioText Or _
    				$msg = $GUI_AST_RadioHTML
    			HandleOutputChange()
    	EndSelect
    WEnd
    
    
    GUIDelete()
    
    
    Exit
    
    
    ;********************************************************************
    ;* LoadWMINamespaces
    ;********************************************************************
    Func LoadWMINamespaces()
    	$strCsvListOfNamespaces = ""
    	$strNameSpacesCombo = ""
    
    
    	$strWaitNamespaces = "Please wait, Loading WMI Namespaces"
    	GUICtrlSetData($GUI_WMI_Namespace, $strWaitNamespaces, $strWaitNamespaces)
    
    
    	EnumNamespaces("root", $strCsvListOfNamespaces)
    
    
    	$arrNamespaces = StringSplit($strCsvListOfNamespaces, ",")
    
    
    	For $strNamespace In $arrNamespaces
    		$strNameSpacesCombo = $strNameSpacesCombo & "|" & $strNamespace
    	Next
    
    
    	GUICtrlSetData($GUI_WMI_Namespace, $strNameSpacesCombo, "ROOT\CIMV2")
    
    
    EndFunc   ;==>LoadWMINamespaces
    
    
    ;********************************************************************
    ;* EnumNamespaces
    ;********************************************************************
    Func EnumNamespaces($strNamespace, ByRef $tmpCsvListOfNamespaces)
    
    
    	If $tmpCsvListOfNamespaces = "" Then
    		$tmpCsvListOfNamespaces = $strNamespace
    	Else
    		$tmpCsvListOfNamespaces = $tmpCsvListOfNamespaces & "," & $strNamespace
    	EndIf
    
    
    	$strComputer = $g_strWMISource
    	$objWMIService = ObjGet("winmgmts:\\" & $g_strWMISource & "\" & $strNamespace)
    
    
    	If Not @error Then
    
    		$colNameSpaces = $objWMIService.InstancesOf ("__NAMESPACE")
    
    
    		For $objNameSpace In $colNameSpaces
    			EnumNamespaces($strNamespace & "\" & $objNameSpace.Name, $tmpCsvListOfNamespaces)
    		Next
    	Else
    		$tmpCsvListOfNamespaces = ""
    	EndIf
    
    
    EndFunc   ;==>EnumNamespaces
    
    
    ;********************************************************************
    ;* HandleNamespaceChange
    ;********************************************************************
    Func HandleNamespaceChange()
    
    
    	;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    	; Clear the WMI classes pulldown location.
    	;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    	$strSelectedNamespace = GUICtrlRead($GUI_WMI_Namespace)
    
    	; Disable the namespace combobox until class load has been completed
    	GUICtrlSetState($GUI_WMI_Namespace, $GUI_DISABLE)
    
    
    	$strWMIWaitMsg = "Please wait, trying to load WMI Classes in namespace " & $strSelectedNamespace
    	GUICtrlSetData($GUI_WMI_Classes, $strWMIWaitMsg, $strWMIWaitMsg)
    	GUICtrlSetData($GUI_AST_ScriptCode, "One moment...", "")
    
    
    	LoadWMIClasses()
    	$g_strCurrentNamespace = "\" & $strSelectedNamespace
    
    
    	;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    	; Clear the code textarea and disable run and save.
    	;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    	GUICtrlSetData($GUI_AST_ScriptCode, "", "")
    
    
    	GUICtrlSetState($GUI_WMI_Namespace, $GUI_ENABLE)
    	GUICtrlSetState($GUI_AST_Run, $GUI_DISABLE)
    	GUICtrlSetState($GUI_AST_Save, $GUI_DISABLE)
    
    
    EndFunc   ;==>HandleNamespaceChange
    
    
    ;********************************************************************
    ;* LoadWMIClasses
    ;*
    ;* Fetch all the classes in the currently selected namespace, and
    ;* populate the keys of a dictionary object with the names of all
    ;* dynamic (non-association) classes. Then we transfer the keys to
    ;* an array, sort the array, and finally use the sorted array to
    ;* populate the WMI classes pulldown.
    ;********************************************************************
    Func LoadWMIClasses()
    
    
    	Const $SORT_KEYS = 1
    	Const $SORT_ITEMS = 2
    
    
    	$objClassDictionary = ObjCreate("Scripting.Dictionary")
    	$objQualifierDictionary = ObjCreate("Scripting.Dictionary")
    
    
    	$strComputer = "."
    	$objWMIService = ObjGet("winmgmts:\\" & $strComputer & $g_strCurrentNamespace)
    
    
    	If Not @error Then
    
    		For $objClass In $objWMIService.SubclassesOf ()
    
    
    			For $objQualifier In $objClass.Qualifiers_ () 	; Dummy (), because it ends with an underscore !
    				$objQualifierDictionary.Add (StringLower($objQualifier.Name), "")
    			Next
    
    
    			If $objQualifierDictionary.Exists ("dynamic") Then
    
    				;$TempVar = $objClass.Path_.Class
    				;$objClassDictionary.Add($TempVar, "")	; Can't use object in arguments ?!!
    
    
    				$objClassDictionary.Add ($objClass.Path_.Class, "")
    
    
    			EndIf
    
    
    			$objQualifierDictionary.RemoveAll
    
    
    		Next
    
    
    		$objQualifierDictionary = ""
    
    
    		;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		; If the current namespace contains dynamic classes...
    		;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		If $objClassDictionary.Count Then
    
    
    			;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    			; Sort the dictionary.
    			;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    			SortDictionary($objClassDictionary, $SORT_KEYS)
    
    
    			;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    			; Populate the WMI classes pulldown with the sorted dictionary.
    			;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    			$strClassesCombo = "|Select a WMI class"
    
    			For $strWMIClass In $objClassDictionary  ;  method .Keys is not an object ??
    				$strClassesCombo = $strClassesCombo & "|" & $strWMIClass
    			Next
    
    
    			GUICtrlSetData($GUI_WMI_Classes, $strClassesCombo, "Select a WMI class")
    
    
    		EndIf
    	EndIf
    
    	If @error Or $objClassDictionary.Count = 0 Then
    		;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		; And if the current namespace doesn't contain dynamic classes.
    		;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		GUICtrlSetData($GUI_WMI_Classes, "|No dynamic classes found in current namespace.|Select a different namespace", "")
    
    	EndIf
    
    
    	$objClassDictionary = ""
    
    
    EndFunc   ;==>LoadWMIClasses
    
    
    ;********************************************************************
    ;* SortDictionary
    ;*
    ;* Shell sort based on:
    ;* http://support.microsoft.com/support/kb/articles/q246/0/67.asp
    ;********************************************************************
    Func SortDictionary(ByRef $objDict, $intSort)
    
    
    	Const $dictKey = 1
    	Const $dictItem = 2
    
    
    	Dim $strDict[1][3]
    
    
    	$intCount = $objDict.Count
    
    
    	If $intCount > 1 Then
    
    
    		ReDim $strDict[$intCount][3]
    
    
    		$i = 0
    		For $objKey In $objDict
    
    
    			$strDict[$i][$dictKey] = String($objKey)
    			$strDict[$i][$dictItem] = String($objDict ($objKey))
    
    			$i = $i + 1
    		Next
    
    
    		;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		; Perform a shell sort of the 2D string array
    		;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		For $i = 0 To ($intCount - 2)
    			For $j = $i To ($intCount - 1)
    				If $strDict[$i][$intSort] > $strDict[$j][$intSort] Then
    					$strKey = $strDict[$i][$dictKey]
    					$strItem = $strDict[$i][$dictItem]
    					$strDict[$i][$dictKey] = $strDict[$j][$dictKey]
    					$strDict[$i][$dictItem] = $strDict[$j][$dictItem]
    					$strDict[$j][$dictKey] = $strKey
    					$strDict[$j][$dictItem] = $strItem
    				EndIf
    			Next
    		Next
    
    
    		;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		; Erase the contents of the dictionary object
    		;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		$objDict.RemoveAll
    
    
    		;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		; Repopulate the dictionary with the sorted information
    		;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		For $i = 0 To ($intCount - 1)
    			$objDict.Add ($strDict[$i][$dictKey], $strDict[$i][$dictItem])
    		Next
    
    
    	EndIf
    
    
    EndFunc   ;==>SortDictionary
    
    
    ;********************************************************************
    ;* ComposeCode
    ;********************************************************************
    Func ComposeCode()
    
    	$objClass = ""
    
    	$strSelectedClass = GUICtrlRead($GUI_WMI_Classes)
    	; Check if a valid class has been selected
    	If $strSelectedClass <> "Select a WMI class" Then
    
    
    		$bHasDates = False  ; Flag: output has date fields
    		$strHeaderStart = Chr(34)
    		$strRowStart = Chr(34)
    		$strColumnSeparator = ": "
    		$strRowEnd = " & @CRLF"
    
    
    
    
    		$strComputerCommand = "$strComputer = " & Chr(34) & $g_strWMISource & Chr(34)
    
    
    		$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & $g_strCurrentNamespace)
    		$objClass = $objWMIService.Get ($strSelectedClass)
    
    
    		If IsObj($objClass) Then
    
    			$strScriptCode = ""
    			$strScriptCode = $strScriptCode & "; Generated by AutoIt Scriptomatic" & @CRLF & @CRLF
    			$strScriptCode = $strScriptCode & "$wbemFlagReturnImmediately = 0x10" & @CRLF
    			$strScriptCode = $strScriptCode & "$wbemFlagForwardOnly = 0x20" & @CRLF
    			$strScriptCode = $strScriptCode & '$colItems = ""' & @CRLF
    			$strScriptCode = $strScriptCode & $strComputerCommand & @CRLF & @CRLF
    			$strScriptCode = $strScriptCode & '$Output=""' & @CRLF
    
    			If $g_strOutputFormat = "HTML" Then
    				$strScriptCode = $strScriptCode & "$Output = $Output & '<html><head><title>Scriptomatic HTML Output</title></head><body> " & _
    						"<style>table {font-size: 10pt; font-family: arial;} th {background-color: buttonface; font-decoration: bold;} " & _
    						"</style><table BORDER=" & Chr(34) & "1" & Chr(34) & "><tr><th>Property</th><th>Value</th></tr>'" & @CRLF
    				$strRowStart = Chr(34) & "<tr><td>"
    				$strHeaderStart = "'<tr bgcolor=" & Chr(34) & "yellow" & Chr(34) & "><td>' & " & Chr(34)
    				$strColumnSeparator = "</td><td>&nbsp;"
    				$strRowEnd = " & " & Chr(34) & "</td></tr>" & Chr(34) & " & @CRLF"
    			EndIf
    
    
    			$strScriptCode = $strScriptCode & "$Output = $Output & " & $strHeaderStart & "Computer" & $strColumnSeparator & Chr(34) & " & $strComputer " & $strRowEnd & @CRLF
    
    			If $g_strOutputFormat = "Dialog" Then
    				$strScriptCode = $strScriptCode & "$Output = $Output & " & Chr(34) & "==========================================" & Chr(34) & $strRowEnd & @CRLF
    			EndIf
    
    			$strScriptCode = $strScriptCode & "$objWMIService = ObjGet(" & Chr(34) & "winmgmts:\\" & Chr(34) & " & $strComputer & " & Chr(34) & $g_strCurrentNamespace & Chr(34) & ")" & @CRLF
    			$strScriptCode = $strScriptCode & "$colItems = $objWMIService.ExecQuery(" & Chr(34) & "SELECT * FROM " & $strSelectedClass & Chr(34) & ", " & Chr(34) & "WQL" & Chr(34) & ", _" & @CRLF
    			$strScriptCode = $strScriptCode & "                                          $wbemFlagReturnImmediately + $wbemFlagForwardOnly)" & @CRLF & @CRLF
    			$strScriptCode = $strScriptCode & "If IsObj($colItems) then" & @CRLF
    			$strScriptCode = $strScriptCode & "   For $objItem In $colItems" & @CRLF
    
    
    			For $objProperty In $objClass.Properties_ () 	; Must use (), because method ends with an underscore
    
    
    				If $objProperty.IsArray = True Then
    					$strScriptCode = $strScriptCode & "      $str" & $objProperty.Name & " = $objItem." & $objProperty.Name & "(0)" & @CRLF
    					$strScriptCode = $strScriptCode & "      $Output = $Output & " & $strRowStart & $objProperty.Name & $strColumnSeparator & Chr(34) & " & $str" & $objProperty.Name & $strRowEnd & @CRLF
    				ElseIf $objProperty.CIMTYPE = 101 Then
    					$bHasDates = True
    					$strScriptCode = $strScriptCode & "      $Output = $Output & " & $strRowStart & $objProperty.Name & $strColumnSeparator & Chr(34) & " & WMIDateStringToDate($objItem." & $objProperty.Name & ")" & $strRowEnd & @CRLF
    				Else
    					$strScriptCode = $strScriptCode & "      $Output = $Output & " & $strRowStart & $objProperty.Name & $strColumnSeparator & Chr(34) & " & $objItem." & $objProperty.Name & $strRowEnd & @CRLF
    				EndIf
    			Next
    
    			If $g_strOutputFormat = "Dialog" Then
    				$strScriptCode = $strScriptCode & '      if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop' & @CRLF
    				$strScriptCode = $strScriptCode & '      $Output=""' & @CRLF
    			EndIf
    			$strScriptCode = $strScriptCode & "   Next" & @CRLF
    
    			If $g_strOutputFormat = "Text" Then
    				$strScriptCode = $strScriptCode & '   ConsoleWrite($Output)' & @CRLF
    				$strScriptCode = $strScriptCode & '   FileWrite(@TempDir & "\' & $strSelectedClass & '.TXT", $Output )' & @CRLF
    				$strScriptCode = $strScriptCode & '   Run(@Comspec & " /c start " & @TempDir & "\' & $strSelectedClass & '.TXT" )' & @CRLF
    			ElseIf $g_strOutputFormat = "HTML" Then
    				$strScriptCode = $strScriptCode & '   FileWrite(@TempDir & "\' & $strSelectedClass & '.HTML", $Output )' & @CRLF
    				$strScriptCode = $strScriptCode & '   Run(@Comspec & " /c start " & @TempDir & "\' & $strSelectedClass & '.HTML" )' & @CRLF
    			EndIf
    
    			$strScriptCode = $strScriptCode & "Else" & @CRLF
    			$strScriptCode = $strScriptCode & '   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & ' & Chr(34) & $strSelectedClass & Chr(34) & ' )' & @CRLF
    
    			$strScriptCode = $strScriptCode & "Endif" & @CRLF
    			$strScriptCode = $strScriptCode & @CRLF & @CRLF
    
    
    			If $bHasDates Then
    				$strScriptCode = $strScriptCode & "Func WMIDateStringToDate($dtmDate)" & @CRLF
    				$strScriptCode = $strScriptCode & @CRLF
    				$strScriptCode = $strScriptCode & Chr(9) & "Return (StringMid($dtmDate, 5, 2) & ""/"" & _" & @CRLF
    				$strScriptCode = $strScriptCode & Chr(9) & "StringMid($dtmDate, 7, 2) & ""/"" & StringLeft($dtmDate, 4) _" & @CRLF
    				$strScriptCode = $strScriptCode & Chr(9) & "& "" "" & StringMid($dtmDate, 9, 2) & "":"" & StringMid($dtmDate, 11, 2) & "":"" & StringMid($dtmDate,13, 2))" & @CRLF
    				$strScriptCode = $strScriptCode & "EndFunc"
    			EndIf
    		Else
    			$strScriptCode = "Error: No Class properties found for " & $g_strCurrentNamespace & "\" & $strSelectedClass
    		EndIf
    
    		GUICtrlSetData($GUI_AST_ScriptCode, $strScriptCode)
    
    
    		;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		; Once the code is successfully composed and put into the
    		; textarea, ensure that the run and save buttons are enabled.
    		;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    		GUICtrlSetState($GUI_AST_Run, $GUI_ENABLE)
    		GUICtrlSetState($GUI_AST_Save, $GUI_ENABLE)
    
    	Else
    		; Disable Run and Save buttons, because no valid code has been generated
    		GUICtrlSetState($GUI_AST_Run, $GUI_DISABLE)
    		GUICtrlSetState($GUI_AST_Save, $GUI_DISABLE)
    	EndIf
    
    EndFunc   ;==>ComposeCode
    
    
    
    
    ;********************************************************************
    ;* RunScript
    ;********************************************************************
    Func RunScript()
    
    
    	;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    	; Create a temporary script file named "temp_script.au3".
    	;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
    
    	$strTmpName = @TempDir & "\temp_script.au3"
    
    
    	If FileExists($strTmpName) Then FileDelete($strTmpName)
    
    
    	FileWrite($strTmpName, GUICtrlRead($GUI_AST_ScriptCode))
    
    
    	;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    	; Start constructing the command line that will run the script...
    	;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    	$strCmdLine = @AutoItExe & " " & $strTmpName
    
    
    	RunWait($strCmdLine)
    
    
    	FileDelete($strTmpName)
    
    
    EndFunc   ;==>RunScript
    
    
    
    
    ;********************************************************************
    ;* SaveScript
    ;********************************************************************
    Func SaveScript()
    
    	$strTmpName = FileSaveDialog("Save Script", @DesktopDir, "AutoIt3 Scripts (*.au3)", 16, GUICtrlRead($GUI_WMI_Classes))
    
    
    	If Not @error And $strTmpName <> "" Then
    		If StringRight($strTmpName, 4) <> ".AU3" Then $strTmpName = $strTmpName & ".AU3"
    		If FileExists($strTmpName) Then FileDelete($strTmpName)
    		FileWrite($strTmpName, GUICtrlRead($GUI_AST_ScriptCode))
    	EndIf
    
    
    EndFunc   ;==>SaveScript
    
    
    
    
    ;********************************************************************
    ;* OpenScript
    ;********************************************************************
    
    
    Func OpenScript()
    
    
    	$strTmpName = FileOpenDialog("Open Script", @DesktopDir, "AutoIt3 Scripts (*.au3)")
    
    
    	If Not @error And $strTmpName <> "" Then
    		If FileExists($strTmpName) Then
    			GUICtrlSetData($GUI_AST_ScriptCode, FileRead($strTmpName, FileGetSize($strTmpName)))
    		EndIf
    	EndIf
    
    
    EndFunc   ;==>OpenScript
    
    
    
    
    ;****************************************************************************
    ;* SetNamespaceToCIMV2
    ;****************************************************************************
    Func SetNamespaceToCIMV2()
    	If StringUpper(GUICtrlRead($GUI_WMI_Namespace)) <> "ROOT\CIMV2" Then
    		GUICtrlSetData($GUI_WMI_Namespace, "ROOT\CIMV2", "ROOT\CIMV2")
    		HandleNamespaceChange()
    	EndIf
    EndFunc   ;==>SetNamespaceToCIMV2
    
    
    ;****************************************************************************
    ;* SetWMIRepository
    ;****************************************************************************
    Func SetWMIRepository()
    
    
    	$strWMISourceName = InputBox("Set WMI Repository Source", _
    			"Please enter the computer whose WMI repository you want to read from: ", _
    			$g_strWMISource)
    	If $strWMISourceName <> "" Then
    
    
    		$g_strWMISource = StringStripWS($strWMISourceName, 1 + 2)
    		;target_computers.Value = $g_strWMISource
    		LoadWMINamespaces()
    	EndIf
    EndFunc   ;==>SetWMIRepository
    
    
    ;****************************************************************************
    ;* HandleOutputChange
    ;****************************************************************************
    Func HandleOutputChange()
    
    	$ChosenFormat = $g_strOutputFormat
    	If GUICtrlRead($GUI_AST_RadioDialog) = $GUI_CHECKED Then $ChosenFormat = "Dialog"
    	If GUICtrlRead($GUI_AST_RadioText) = $GUI_CHECKED Then $ChosenFormat = "Text"
    	If GUICtrlRead($GUI_AST_RadioHTML) = $GUI_CHECKED Then $ChosenFormat = "HTML"
    	If $ChosenFormat <> $g_strOutputFormat Then
    		$g_strOutputFormat = $ChosenFormat
    		ComposeCode()
    	EndIf
    EndFunc   ;==>HandleOutputChange
    
    
    
    
    Func _ComboSearch($combo,$search,$startin = 0)
    	For $i = $startin To _GUICtrlComboGetCount($combo)
    		$text = ""
    		_GUICtrlComboGetLBText($combo,$i,$text)
    		If StringInStr($text,$search) Then Return $i
    	Next
    	Return -1
    EndFunc
    Alles anzeigen

    Mfg spider

  • Wie markiertes Item aus einer GuiCtrlList löschen?

    • GtaSpider
    • 3. September 2006 um 15:23

    Hallo!

    Such mal in der hilfe nach _GuiCtrlListGetIndex oder sowas!

    Mfg Spider

  • Problem mit Passwortabfrage

    • GtaSpider
    • 3. September 2006 um 13:08

    Hallo!

    Achso ;) sag das doch :D dann würde ich das aber nicht mit If $passwd < 2 Then machen sondern mit "If @error Then" <-- muss direkt unter der inputbox stehen!

    Mfg Spider

  • GUICtrlCreateListViewItem macht aus mehreren zeilen eine Zeile

    • GtaSpider
    • 3. September 2006 um 12:12

    Hallo!

    Das mit dem quatrad hängt damit zusammen das ein nichtlesbares zeichen (für das listview) gegeben wurde (z.b. @CR oder @CRLF oder @LF)
    Probier das mal:

    Code
    For $v = 1 To $Zeilen[0] Step 1
    	GUICtrlCreateListViewItem(StringReplace($Zeilen[$v], @CR, ""), $out)
    Next

    Mfg Spider

  • Problem mit Passwortabfrage

    • GtaSpider
    • 3. September 2006 um 12:07

    Hallo Analyzer!

    Was sucht das Return dadrin? Ist doch keine funktion fazit abbruch!

    Der eigentliche fehler lag aber dadrin: If $passwd < 2 Then! Wenn du die länge vln $passwd ermitteln willst geht das mit StringLen!

    Hier mal das funktionierende skript:

    Code
    If IniRead(@ScriptDir & "\settings.ini", "PWaktiv", "Wert", "") = 0 Then
    	MsgBox(0, "Passwort deativiert", "Passwortabfrage ist deaktiviert")
    Else
    	Do
    		$passwd = InputBox("Passwort-Check", "Bitte geben Sie Ihr Passwort ein.", "", "*M")
    		ConsoleWrite($passwd)
    		If StringLen($passwd) < 2 Then
    			Exit
    		ElseIf $passwd <> "Geheim" Then
    			$iMsgBoxAnswer = MsgBox(53, "Anmeldung fehlgeschlagen!", "Ihr Passwort ist falsch!")
    		Else
    			MsgBox(0, "Passwort ativiert", "Anmeldung erfolgreich")
    		EndIf
    	Until $iMsgBoxAnswer <> 4
    ;~ 	Return $passwd
    EndIf
    Alles anzeigen

    Mfg Spider

  • @SW_HIDE

    • GtaSpider
    • 2. September 2006 um 19:31

    Hallo!

    Ja! Das problem ist das man (wie in dem bsp) alles übersieht was man nur übersehen kann..

    Mfg spider

  • @SW_HIDE

    • GtaSpider
    • 2. September 2006 um 12:59

    Hallo exberliner ;)

    Der Syntax von Run geht so: ("Pfad/Datei","Pfad","Optionen")
    "Brauchen" tutst du da meistens nur "Pfad/Datei"! Also.. so gehtz:

    Code
    RunWait (@ComSpec & " /c " & 'net stop "OfficeScanNT Listener"',"",@SW_HIDE)

    Mfg Spider ;)

  • ShowAllServices

    • GtaSpider
    • 1. September 2006 um 17:01

    Hallo!

    joa.. aber davon is ca die hälfte stopped.. wollt ihr sie sehen? =)

    Spoiler anzeigen

    Computer: MAX-01
    lfd. ServiceName ProcessId StartMode State
    1 AcrSch2Svc 2164 Auto Running
    2 Alerter 0 Disabled Stopped
    3 ALG 3980 Manual Running
    4 AppMgmt 0 Manual Stopped
    5 aspnet_state 0 Manual Stopped
    6 Ati HotKey Poller 1392 Auto Running
    7 ATI Smart 0 Auto Stopped
    8 AudioSrv 1912 Auto Running
    9 AVKProxy 2196 Auto Running
    10 AVKService 2208 Auto Running
    11 AVKWCtl 2244 Auto Running
    12 BITS 0 Manual Stopped
    13 Browser 1912 Auto Running
    14 ccEvtMgr 1060 Auto Running
    15 ccPwdSvc 0 Manual Stopped
    16 ccSetMgr 924 Auto Running
    17 CiSvc 0 Manual Stopped
    18 ClipSrv 0 Disabled Stopped
    19 COMSysApp 0 Manual Stopped
    20 CryptSvc 1912 Auto Running
    21 DcomLaunch 1404 Auto Running
    22 Dhcp 1912 Auto Running
    23 dmadmin 0 Manual Stopped
    24 dmserver 1912 Auto Running
    25 Dnscache 1960 Auto Running
    26 ERSvc 1912 Auto Running
    27 Eventlog 1216 Auto Running
    28 EventSystem 1912 Manual Running
    29 FastUserSwitchingCompatibility 1912 Manual Running
    30 helpsvc 1912 Auto Running
    31 HidServ 1912 Auto Running
    32 HTTPFilter 0 Manual Stopped
    33 ImapiService 0 Manual Stopped
    34 lanmanserver 1912 Auto Running
    35 lanmanworkstation 1912 Auto Running
    36 LmHosts 2036 Auto Running
    37 Messenger 0 Disabled Stopped
    38 mnmsrvc 0 Manual Stopped
    39 MSDTC 0 Manual Stopped
    40 MSIServer 0 Manual Stopped
    41 NetDDE 0 Disabled Stopped
    42 NetDDEdsdm 0 Disabled Stopped
    43 Netlogon 0 Manual Stopped
    44 Netman 1912 Manual Running
    45 Nla 1912 Manual Running
    46 NProtectService 2340 Auto Running
    47 NtLmSsp 0 Manual Stopped
    48 NtmsSvc 0 Manual Stopped
    49 ose 0 Manual Stopped
    50 PlugPlay 1216 Auto Running
    51 PolicyAgent 1228 Auto Running
    52 ProtectedStorage 1228 Auto Running
    53 RasAuto 0 Manual Stopped
    54 RasMan 0 Manual Stopped
    55 RDSessMgr 0 Manual Stopped
    56 RemoteAccess 0 Disabled Stopped
    57 RemoteRegistry 2036 Auto Running
    58 RpcLocator 0 Manual Stopped
    59 RpcSs 1492 Auto Running
    60 RSVP 0 Manual Stopped
    61 SamSs 1228 Auto Running
    62 SCardSvr 0 Manual Stopped
    63 Schedule 1912 Auto Running
    64 seclogon 1912 Auto Running
    65 SENS 1912 Auto Running
    66 sfrem01 0 Auto Stopped
    67 SharedAccess 1912 Auto Running
    68 ShellHWDetection 1912 Auto Running
    69 SoundMAX Agent Service (default) 2860 Auto Running
    70 Speed Disk service 2884 Auto Running
    71 Spooler 1612 Auto Running
    72 srservice 1912 Auto Running
    73 SSDPSRV 0 Disabled Stopped
    74 stisvc 0 Manual Stopped
    75 SwPrv 0 Manual Stopped
    76 Symantec Core LC 2904 Auto Running
    77 SysmonLog 0 Manual Stopped
    78 TapiSrv 0 Manual Stopped
    79 TermService 1404 Manual Running
    80 Themes 1912 Auto Running
    81 TlntSvr 0 Disabled Stopped
    82 TrkWks 1912 Auto Running
    83 TUWinStylerThemeSvc 0 Manual Stopped
    84 UMWdf 2960 Auto Running
    85 upnphost 0 Disabled Stopped
    86 UPS 0 Manual Stopped
    87 VMAuthdService 3004 Auto Running
    88 VMnetDHCP 3144 Auto Running
    89 vmount2 3052 Auto Running
    90 VMware NAT Service 3068 Auto Running
    91 VSS 0 Manual Stopped
    92 W32Time 1912 Auto Running
    93 WebClient 2036 Auto Running
    94 winmgmt 1912 Auto Running
    95 WmdmPmSN 0 Manual Stopped
    96 Wmi 0 Manual Stopped
    97 WmiApSrv 0 Manual Stopped
    98 wscsvc 1912 Auto Running
    99 wuauserv 1912 Auto Running
    100 WZCSVC 1912 Auto Running
    101 xmlprov 0 Manual Stopped

  • ShowAllServices

    • GtaSpider
    • 1. September 2006 um 16:45

    Hallo!

    Du wider mit deinem htlm ;) Sieht gut aus! brauch ich momentan nicht, ist aber bestimmt nützlich wenn man mal nich weiter kommt mit windoof..ich hab genau 101 service an =)

    Mfg Spider

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™