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. Xenobiologist

Beiträge von Xenobiologist

  • OrganizeIncludes

    • Xenobiologist
    • 16. Mai 2008 um 21:47

    Hi,

    welche Version von OI nutzt du und welchen Fehler bekommst du?

    Mega

  • Ergebnis der Kommandozeile in neuen Befehl übernehmen

    • Xenobiologist
    • 16. Mai 2008 um 21:09

    Puh, schwere Geburt.

    So sollte es auch gehen und schöner aussehen:

    Spoiler anzeigen
    [autoit]


    Global $n0 = _getDOSOutput('rsm view /tphysical_media /b /cg178081F3FCB74242907808DC711B1CF1')
    Global $n1 = _getDOSOutput('rsm view /tpartition /b /cg' & $n0)
    Global $n2 = _getDOSOutput('rsm view /tlogical_media /b /cg' & $n1)

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

    ClipPut(_createSerial($n2))
    MsgBox(64, 'GUID-name', "GUID-name des Bandes: " & _createSerial($n2) & @CRLF & @CRLF & "Die ID wurde in die Zwischenablage kopiert.", 10)

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

    Func _getDOSOutput($command)
    Local $text = '', $Pid = Run('"' & @ComSpec & '" /c ' & $command, '', @SW_HIDE, 2 + 4)
    While 1
    $text &= StdoutRead($Pid);, False, False)
    If @error Then ExitLoop
    Sleep(10)
    WEnd
    Return StringRegExpReplace($text, "(?i)[^a-z0-9]", "")
    EndFunc ;==>_getDOSOutput

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

    Func _createSerial($str)
    Return StringLeft($str, 8) & '-' & StringMid($str, 9, 4) & '-' & StringMid($str, 14, 4) & '-' & StringMid($str, 19, 4) & '-' & StringRight($str, 12)
    EndFunc ;==>_createSerial

    [/autoit]

    Mega

  • Dllcall return variable zu kurz

    • Xenobiologist
    • 16. Mai 2008 um 21:03

    Ich denke mal weil es kein Pointer ist.

  • Dynamische Funktionen ? Heisst das so :)

    • Xenobiologist
    • 16. Mai 2008 um 17:24

    Nicht nur schlechter Stil, es ist auch viel langsamer!

    Mega

  • frage zu tcp

    • Xenobiologist
    • 16. Mai 2008 um 17:23

    Hi,

    wozu das Rad neu erfinden? Nutz doch Hamachi VPN VNC .... Tools und Techniken gibt es genug.

    Des Weiteren musst du Firewalls freischalten, Router konfig vornehmen ggf. Port weitergeben usw.

    Mega

  • Pic aus dlls holen

    • Xenobiologist
    • 16. Mai 2008 um 17:21

    Na also! :thumbup:

  • Pic aus dlls holen

    • Xenobiologist
    • 16. Mai 2008 um 16:57

    Gib es einfach mal bei Google ein. Dann wirst du fündig.

    Es ist kostenlos.

    Mega

  • Pic aus dlls holen

    • Xenobiologist
    • 16. Mai 2008 um 16:52

    Hi,

    einfach Resourcehacker nutzen.

    Mega

  • Ergebnis der Kommandozeile in neuen Befehl übernehmen

    • Xenobiologist
    • 16. Mai 2008 um 15:49

    Hi,

    versuch doch selbst mal ein bißchen. Und wenn du das Problem beschreiben und eingrenzen sowieso reproduzieren kannst, dann meldest du dich nochmal.

    Ansonsten raten wir nur

    Mega

  • Prüfen ob ein Windows Dienst gestartet ist.

    • Xenobiologist
    • 16. Mai 2008 um 15:16
    Spoiler anzeigen
    [autoit]

    Global $STANDARD_RIGHTS_REQUIRED = 0x000F0000

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

    ; Service Control Manager access types
    Global $SC_MANAGER_CONNECT = 0x0001
    Global $SC_MANAGER_CREATE_SERVICE = 0x0002
    Global $SC_MANAGER_ENUMERATE_SERVICE = 0x0004
    Global $SC_MANAGER_LOCK = 0x0008
    Global $SC_MANAGER_QUERY_LOCK_STATUS = 0x0010
    Global $SC_MANAGER_MODIFY_BOOT_CONFIG = 0x0020

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

    Global $SC_MANAGER_ALL_ACCESS = BitOR($STANDARD_RIGHTS_REQUIRED, _
    $SC_MANAGER_CONNECT, _
    $SC_MANAGER_CREATE_SERVICE, _
    $SC_MANAGER_ENUMERATE_SERVICE, _
    $SC_MANAGER_LOCK, _
    $SC_MANAGER_QUERY_LOCK_STATUS, _
    $SC_MANAGER_MODIFY_BOOT_CONFIG)

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

    ; Service access types
    Global $SERVICE_QUERY_CONFIG = 0x0001
    Global $SERVICE_CHANGE_CONFIG = 0x0002
    Global $SERVICE_QUERY_STATUS = 0x0004
    Global $SERVICE_ENUMERATE_DEPENDENTS = 0x0008
    Global $SERVICE_START = 0x0010
    Global $SERVICE_STOP = 0x0020
    Global $SERVICE_PAUSE_CONTINUE = 0x0040
    Global $SERVICE_INTERROGATE = 0x0080
    Global $SERVICE_USER_DEFINED_CONTROL = 0x0100

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

    Global $SERVICE_ALL_ACCESS = BitOR($STANDARD_RIGHTS_REQUIRED, _
    $SERVICE_QUERY_CONFIG, _
    $SERVICE_CHANGE_CONFIG, _
    $SERVICE_QUERY_STATUS, _
    $SERVICE_ENUMERATE_DEPENDENTS, _
    $SERVICE_START, _
    $SERVICE_STOP, _
    $SERVICE_PAUSE_CONTINUE, _
    $SERVICE_INTERROGATE, _
    $SERVICE_USER_DEFINED_CONTROL)

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

    ; Service controls
    Global $SERVICE_CONTROL_STOP = 0x00000001
    Global $SERVICE_CONTROL_PAUSE = 0x00000002
    Global $SERVICE_CONTROL_CONTINUE = 0x00000003
    Global $SERVICE_CONTROL_INTERROGATE = 0x00000004
    Global $SERVICE_CONTROL_SHUTDOWN = 0x00000005
    Global $SERVICE_CONTROL_PARAMCHANGE = 0x00000006
    Global $SERVICE_CONTROL_NETBINDADD = 0x00000007
    Global $SERVICE_CONTROL_NETBINDREMOVE = 0x00000008
    Global $SERVICE_CONTROL_NETBINDENABLE = 0x00000009
    Global $SERVICE_CONTROL_NETBINDDISABLE = 0x0000000A
    Global $SERVICE_CONTROL_DEVICEEVENT = 0x0000000B
    Global $SERVICE_CONTROL_HARDWAREPROFILECHANGE = 0x0000000C
    Global $SERVICE_CONTROL_POWEREVENT = 0x0000000D
    Global $SERVICE_CONTROL_SESSIONCHANGE = 0x0000000E

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

    ; Service types
    Global $SERVICE_KERNEL_DRIVER = 0x00000001
    Global $SERVICE_FILE_SYSTEM_DRIVER = 0x00000002
    Global $SERVICE_ADAPTER = 0x00000004
    Global $SERVICE_RECOGNIZER_DRIVER = 0x00000008
    Global $SERVICE_DRIVER = BitOR($SERVICE_KERNEL_DRIVER, _
    $SERVICE_FILE_SYSTEM_DRIVER, _
    $SERVICE_RECOGNIZER_DRIVER)
    Global $SERVICE_WIN32_OWN_PROCESS = 0x00000010
    Global $SERVICE_WIN32_SHARE_PROCESS = 0x00000020
    Global $SERVICE_WIN32 = BitOR($SERVICE_WIN32_OWN_PROCESS, _
    $SERVICE_WIN32_SHARE_PROCESS)
    Global $SERVICE_INTERACTIVE_PROCESS = 0x00000100
    Global $SERVICE_TYPE_ALL = BitOR($SERVICE_WIN32, _
    $SERVICE_ADAPTER, _
    $SERVICE_DRIVER, _
    $SERVICE_INTERACTIVE_PROCESS)

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

    ; Service start types
    Global $SERVICE_BOOT_START = 0x00000000
    Global $SERVICE_SYSTEM_START = 0x00000001
    Global $SERVICE_AUTO_START = 0x00000002
    Global $SERVICE_DEMAND_START = 0x00000003
    Global $SERVICE_DISABLED = 0x00000004

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

    ; Service error control
    Global $SERVICE_ERROR_IGNORE = 0x00000000
    Global $SERVICE_ERROR_NORMAL = 0x00000001
    Global $SERVICE_ERROR_SEVERE = 0x00000002
    Global $SERVICE_ERROR_CRITICAL = 0x00000003

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

    ;===============================================================================
    ; Description: Starts a service on a computer
    ; Parameters: $sComputerName - name of the target computer. If empty, the local computer name is used
    ; $sServiceName - name of the service to start
    ; Requirements: None
    ; Return Values: On Success - 1
    ; On Failure - 0 and @error is set to extended Windows error code
    ; Note: This function does not check to see if the service has started successfully
    ;===============================================================================
    Func _StartService($sComputerName, $sServiceName)
    Local $hAdvapi32
    Local $hKernel32
    Local $arRet
    Local $hSC
    Local $hService
    Local $lError = -1

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

    $hAdvapi32 = DllOpen("advapi32.dll")
    If $hAdvapi32 = -1 Then Return 0
    $hKernel32 = DllOpen("kernel32.dll")
    If $hKernel32 = -1 Then Return 0
    $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _
    "str", $sComputerName, _
    "str", "ServicesActive", _
    "long", $SC_MANAGER_CONNECT)
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    Else
    $hSC = $arRet[0]
    $arRet = DllCall($hAdvapi32, "long", "OpenService", _
    "long", $hSC, _
    "str", $sServiceName, _
    "long", $SERVICE_START)
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    Else
    $hService = $arRet[0]
    $arRet = DllCall($hAdvapi32, "int", "StartService", _
    "long", $hService, _
    "long", 0, _
    "str", "")
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    EndIf
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hService)
    EndIf
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC)
    EndIf
    DllClose($hAdvapi32)
    DllClose($hKernel32)
    If $lError <> -1 Then
    SetError($lError)
    Return 0
    EndIf
    Return 1
    EndFunc

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

    ;===============================================================================
    ; Description: Stops a service on a computer
    ; Parameters: $sComputerName - name of the target computer. If empty, the local computer name is used
    ; $sServiceName - name of the service to stop
    ; Requirements: None
    ; Return Values: On Success - 1
    ; On Failure - 0 and @error is set to extended Windows error code
    ; Note: This function does not check to see if the service has stopped successfully
    ;===============================================================================
    Func _StopService($sComputerName, $sServiceName)
    Local $hAdvapi32
    Local $hKernel32
    Local $arRet
    Local $hSC
    Local $hService
    Local $lError = -1

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

    $hAdvapi32 = DllOpen("advapi32.dll")
    If $hAdvapi32 = -1 Then Return 0
    $hKernel32 = DllOpen("kernel32.dll")
    If $hKernel32 = -1 Then Return 0
    $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _
    "str", $sComputerName, _
    "str", "ServicesActive", _
    "long", $SC_MANAGER_CONNECT)
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    Else
    $hSC = $arRet[0]
    $arRet = DllCall($hAdvapi32, "long", "OpenService", _
    "long", $hSC, _
    "str", $sServiceName, _
    "long", $SERVICE_STOP)
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    Else
    $hService = $arRet[0]
    $arRet = DllCall($hAdvapi32, "int", "ControlService", _
    "long", $hService, _
    "long", $SERVICE_CONTROL_STOP, _
    "str", "")
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    EndIf
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hService)
    EndIf
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC)
    EndIf
    DllClose($hAdvapi32)
    DllClose($hKernel32)
    If $lError <> -1 Then
    SetError($lError)
    Return 0
    EndIf
    Return 1
    EndFunc

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

    ;===============================================================================
    ; Description: Checks if a service exists on a computer
    ; Parameters: $sComputerName - name of the target computer. If empty, the local computer name is used
    ; $sServiceName - name of the service to check
    ; Requirements: None
    ; Return Values: On Success - 1
    ; On Failure - 0
    ;===============================================================================
    Func _ServiceExists($sComputerName, $sServiceName)
    Local $hAdvapi32
    Local $arRet
    Local $hSC
    Local $bExist = 0

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

    $hAdvapi32 = DllOpen("advapi32.dll")
    If $hAdvapi32 = -1 Then Return 0
    $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _
    "str", $sComputerName, _
    "str", "ServicesActive", _
    "long", $SC_MANAGER_CONNECT)
    If $arRet[0] <> 0 Then
    $hSC = $arRet[0]
    $arRet = DllCall($hAdvapi32, "long", "OpenService", _
    "long", $hSC, _
    "str", $sServiceName, _
    "long", $SERVICE_INTERROGATE)
    If $arRet[0] <> 0 Then
    $bExist = 1
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $arRet[0])
    EndIf
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC)
    EndIf
    DllClose($hAdvapi32)
    Return $bExist
    EndFunc

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

    ;===============================================================================
    ; Description: Checks if a service is running on a computer
    ; Parameters: $sComputerName - name of the target computer. If empty, the local computer name is used
    ; $sServiceName - name of the service to check
    ; Requirements: None
    ; Return Values: On Success - 1
    ; On Failure - 0
    ; Note: This function relies on the fact that only a running service responds
    ; to a SERVICE_CONTROL_INTERROGATE control code. Check the ControlService
    ; page on MSDN for limitations with using this method.
    ;===============================================================================
    Func _ServiceRunning($sComputerName, $sServiceName)
    Local $hAdvapi32
    Local $arRet
    Local $hSC
    Local $hService
    Local $bRunning = 0

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

    $hAdvapi32 = DllOpen("advapi32.dll")
    If $hAdvapi32 = -1 Then Return 0
    $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _
    "str", $sComputerName, _
    "str", "ServicesActive", _
    "long", $SC_MANAGER_CONNECT)
    If $arRet[0] <> 0 Then
    $hSC = $arRet[0]
    $arRet = DllCall($hAdvapi32, "long", "OpenService", _
    "long", $hSC, _
    "str", $sServiceName, _
    "long", $SERVICE_INTERROGATE)
    If $arRet[0] <> 0 Then
    $hService = $arRet[0]
    $arRet = DllCall($hAdvapi32, "int", "ControlService", _
    "long", $hService, _
    "long", $SERVICE_CONTROL_INTERROGATE, _
    "str", "")
    $bRunning = $arRet[0]
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hService)
    EndIf
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC)
    EndIf
    DllClose($hAdvapi32)
    Return $bRunning
    EndFunc

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

    ;===============================================================================
    ; Description: Creates a service on a computer
    ; Parameters: $sComputerName - name of the target computer. If empty, the local computer name is used
    ; $sServiceName - name of the service to create
    ; $sDisplayName - display name of the service
    ; $sBinaryPath - fully qualified path to the service binary file
    ; The path can also include arguments for an auto-start service
    ; $sServiceUser - [optional] default is LocalSystem
    ; name of the account under which the service should run
    ; $sPassword - [optional] default is empty
    ; password to the account name specified by $sServiceUser
    ; Specify an empty string if the account has no password or if the service
    ; runs in the LocalService, NetworkService, or LocalSystem account
    ; $nServiceType - [optional] default is $SERVICE_WIN32_OWN_PROCESS
    ; $nStartType - [optional] default is $SERVICE_AUTO_START
    ; $nErrorType - [optional] default is $SERVICE_ERROR_NORMAL
    ; $nDesiredAccess - [optional] default is $SERVICE_ALL_ACCESS
    ; $sLoadOrderGroup - [optional] default is empty
    ; names the load ordering group of which this service is a member
    ; Requirements: Administrative rights on the computer
    ; Return Values: On Success - 1
    ; On Failure - 0 and @error is set to extended Windows error code
    ; Note: Dependencies cannot be specified using this function
    ; Refer to the CreateService page on MSDN for more information
    ;===============================================================================
    Func _CreateService($sComputerName, _
    $sServiceName, _
    $sDisplayName, _
    $sBinaryPath, _
    $sServiceUser = "LocalSystem", _
    $sPassword = "", _
    $nServiceType = 0x00000010, _
    $nStartType = 0x00000002, _
    $nErrorType = 0x00000001, _
    $nDesiredAccess = 0x000f01ff, _
    $sLoadOrderGroup = "")
    Local $hAdvapi32
    Local $hKernel32
    Local $arRet
    Local $hSC
    Local $lError = -1

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

    $hAdvapi32 = DllOpen("advapi32.dll")
    If $hAdvapi32 = -1 Then Return 0
    $hKernel32 = DllOpen("kernel32.dll")
    If $hKernel32 = -1 Then Return 0
    $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _
    "str", $sComputerName, _
    "str", "ServicesActive", _
    "long", $SC_MANAGER_ALL_ACCESS)
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    Else
    $hSC = $arRet[0]
    $arRet = DllCall($hAdvapi32, "long", "OpenService", _
    "long", $hSC, _
    "str", $sServiceName, _
    "long", $SERVICE_INTERROGATE)
    If $arRet[0] = 0 Then
    $arRet = DllCall($hAdvapi32, "long", "CreateService", _
    "long", $hSC, _
    "str", $sServiceName, _
    "str", $sDisplayName, _
    "long", $nDesiredAccess, _
    "long", $nServiceType, _
    "long", $nStartType, _
    "long", $nErrorType, _
    "str", $sBinaryPath, _
    "str", $sLoadOrderGroup, _
    "ptr", 0, _
    "str", "", _
    "str", $sServiceUser, _
    "str", $sPassword)
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    Else
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $arRet[0])
    EndIf
    Else
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $arRet[0])
    EndIf
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC)
    EndIf
    DllClose($hAdvapi32)
    DllClose($hKernel32)
    If $lError <> -1 Then
    SetError($lError)
    Return 0
    EndIf
    Return 1
    EndFunc

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

    ;===============================================================================
    ; Description: Deletes a service on a computer
    ; Parameters: $sComputerName - name of the target computer. If empty, the local computer name is used
    ; $sServiceName - name of the service to delete
    ; Requirements: Administrative rights on the computer
    ; Return Values: On Success - 1
    ; On Failure - 0 and @error is set to extended Windows error code
    ;===============================================================================
    Func _DeleteService($sComputerName, $sServiceName)
    Local $hAdvapi32
    Local $hKernel32
    Local $arRet
    Local $hSC
    Local $hService
    Local $lError = -1

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

    $hAdvapi32 = DllOpen("advapi32.dll")
    If $hAdvapi32 = -1 Then Return 0
    $hKernel32 = DllOpen("kernel32.dll")
    If $hKernel32 = -1 Then Return 0
    $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _
    "str", $sComputerName, _
    "str", "ServicesActive", _
    "long", $SC_MANAGER_ALL_ACCESS)
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    Else
    $hSC = $arRet[0]
    $arRet = DllCall($hAdvapi32, "long", "OpenService", _
    "long", $hSC, _
    "str", $sServiceName, _
    "long", $SERVICE_ALL_ACCESS)
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    Else
    $hService = $arRet[0]
    $arRet = DllCall($hAdvapi32, "int", "DeleteService", _
    "long", $hService)
    If $arRet[0] = 0 Then
    $arRet = DllCall($hKernel32, "long", "GetLastError")
    $lError = $arRet[0]
    EndIf
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hService)
    EndIf
    DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC)
    EndIf
    DllClose($hAdvapi32)
    DllClose($hKernel32)
    If $lError <> -1 Then
    SetError($lError)
    Return 0
    EndIf
    Return 1
    EndFunc

    [/autoit]

    Mega

  • Ergebnis der Kommandozeile in neuen Befehl übernehmen

    • Xenobiologist
    • 16. Mai 2008 um 12:52

    Vergleich mal wo der Fehler ist

    Spoiler anzeigen
    [autoit]

    $n = _getDOSOutput('rsm view /tphysical_media /b /cg178081F3FCB74242907808DC711B1CF1')
    ConsoleWrite($n & @CRLF)
    $n2 = _getDOSOutput('rsm view /tpartition /b /cg' & $n)
    ConsoleWrite($n2 & @CRLF)
    $nummer = _getDOSOutput('rsm view /tlogical_media /b /cg' & $n2)
    ConsoleWrite($nummer & @CRLF)
    MsgBox(64, 'DOS', _createSerial($nummer))

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

    Func _getDOSOutput($command)
    Local $text = '', $Pid = Run('"' & @ComSpec & '" /c ' & $command, '', @SW_HIDE, 2 + 4)
    While 1
    $text &= StdoutRead($Pid);, False, False)
    If @error Then ExitLoop
    Sleep(10)
    WEnd
    Return $text
    EndFunc ;==>_getDOSOutput

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

    Func _createSerial($str)
    Return StringLeft($str, 8) & '-' & StringMid($str, 9, 4) & '-' & StringMid($str, 14, 4) & '-' & StringMid($str, 19, 4) & '-' & StringRight($str, 12)
    EndFunc ;==>_createSerial

    [/autoit]

    Mega

  • Funktion - mehrere Steuerelemente verstecken

    • Xenobiologist
    • 16. Mai 2008 um 12:49

    Hier ein Beispiel:

    Spoiler anzeigen
    [autoit]

    ;GUI

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

    #include <GUIConstants.au3>

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

    #region ### START Koda GUI section ### Form=
    GUICreate("Form1", 219, 150, 193, 125)
    Global $button_A[3]
    $button_A[0] = GUICtrlCreateButton("Button1", 8, 8, 75, 25, 0)
    $button_A[1] = GUICtrlCreateButton("Button2", 8, 40, 75, 25, 0)
    $button_A[2] = GUICtrlCreateButton("Button3", 8, 72, 75, 25, 0)
    $Input1 = GUICtrlCreateInput("Input1", 88, 8, 121, 21)
    $Input2 = GUICtrlCreateInput("Input2", 88, 40, 121, 21)
    $Input3 = GUICtrlCreateInput("Input3", 88, 72, 121, 21)
    $hide_B = GUICtrlCreateButton("HIDE", 16, 112, 187, 25, 0)
    Global $CIDs[3] = [$Input1, $Input2, $Input3]
    Global $state = True
    GUISetState(@SW_SHOW)
    #endregion ### START Koda GUI section ### Form=

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $hide_B
    If $state Then
    For $i = 0 To UBound($button_A) - 1
    GUICtrlSetState($button_A[$i], $GUI_HIDE)
    Next
    For $i = 0 To UBound($CIDs) - 1
    GUICtrlSetState($CIDs[$i], $GUI_DISABLE)
    Next
    Else
    For $i = 0 To UBound($button_A) - 1
    GUICtrlSetState($button_A[$i], $GUI_SHOW)
    Next
    For $i = 0 To UBound($CIDs) - 1
    GUICtrlSetState($CIDs[$i], $GUI_ENABLE)
    Next
    EndIf
    $state = Not $state
    EndSwitch
    WEnd

    [/autoit]

    Mega

  • Funktion - mehrere Steuerelemente verstecken

    • Xenobiologist
    • 16. Mai 2008 um 11:56

    Hi,

    bau dir ein Array mit den ganzen ControlIds und dann iteriere mit einer Schleife durch und setz den Befehl ab.

    Mega

  • Ergebnis der Kommandozeile in neuen Befehl übernehmen

    • Xenobiologist
    • 16. Mai 2008 um 11:53
    Zitat von progandy

    Weiß auch net, warum. Jetzt geht es wieder so ?(

    Ich glaube das Problem ist eher Release oder Beta Version. EGAL! :D

    Probier mal dies:

    [autoit]

    $n = _getDOSOutput('rsm view /tphysical_media /b /cg178081F3FCB74242907808DC711B1CF1')
    $n2 = _getDOSOutput('rsm view /tpartition /b /cg' & $n)
    $nummer = _getDOSOutput('rsm view /tlogical_media /b /cg' & $n2)

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

    MsgBox(64, 'DOS', _createSerial($nummer))

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

    Func _getDOSOutput($command)
    Local $text = '', $Pid = Run('"' & @ComSpec & '" /c ' & $command, '', @SW_HIDE, 2 + 4)
    While 1
    $text &= StdoutRead($Pid);, False, False)
    If @error Then ExitLoop
    Sleep(10)
    WEnd
    Return $text
    EndFunc ;==>_getDOSOutput

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

    Func _createSerial($str)
    Return StringLeft($str, 8) & '-' & StringMid($str, 9, 4) & '-' & StringMid($str, 14, 4) & '-' & StringMid($str, 19, 4) & '-' & StringRight($str, 12)
    EndFunc ;==>_createSerial

    [/autoit]

    Mega

  • STRG+c für Ping Script

    • Xenobiologist
    • 16. Mai 2008 um 11:43
    Zitat von remax

    Wird schon mal einiges verständlicher, aber was sind Metazeichen? Und gibt es eine Liste wo man nachschauen kann?
    Xeno, wieso kennst du dich so gut mit aus? Haste Autoit mit entworfen?

    Hi,
    für Metazeichen einfach mal hier gucken : http://de.wikipedia.org/wiki/Metazeichen

    :D nein. Ich bin auch nur Autoitnutzer. Allerdings lese ich seit 2 jahren mehr oder weniger regelmäßig in beiden Foren. Das prägt. :thumbup:

    Mega

  • STRG+c für Ping Script

    • Xenobiologist
    • 16. Mai 2008 um 09:00
    Zitat von muh_kuh

    wie währe es mit :

    [autoit]

    Ping()

    [/autoit]

    Vor allem : AN ALLE MITGLIEDER DIESES FORUMS : WÄRE WIRD OHNE!!! "H" GESCHRIEBEN! :cursing:

  • Var Call

    • Xenobiologist
    • 16. Mai 2008 um 08:57

    Hi,

    wenn du keinen Status protokollierst, dann geht das nicht. Die Variable kann die nur den IST-Zustand anzeigen.

    Mega

  • selbstlöschen

    • Xenobiologist
    • 15. Mai 2008 um 16:14

    Hi,

    Mit oder ohne Scite dann sowas:

    [autoit]

    HotKeySet("1", "_end")
    Opt("OnExitFunc", "_SelfDelete")

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

    While 1
    Sleep(500)
    WEnd

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

    Func _SelfDelete()
    Local $cmdfile
    FileDelete(@TempDir & "\scratch.cmd")
    $cmdfile = ':loop' & @CRLF _
    & 'del "' & @ScriptFullPath & '"' & @CRLF _
    & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _
    & 'del ' & @TempDir & '\scratch.cmd'
    FileWrite(@TempDir & "\scratch.cmd", $cmdfile)
    Run(@TempDir & "\scratch.cmd", @TempDir, @SW_HIDE)
    EndFunc ;==>_SelfDelete

    [/autoit]

    Mega

  • Automatische Mausbewegung und Bestätigung durch Mausklicks in unterscheidlichen Zeitintervallen

    • Xenobiologist
    • 15. Mai 2008 um 16:12

    Was ist denn das für eine Frage?

    Versuch es doch einfach mal:

    1) GUI zu erfragen der Startzeit
    2) Schleife die wartet bis Startzeit erreicht
    3) Start der Funktion

    Mega

  • Ergebnis der Kommandozeile in neuen Befehl übernehmen

    • Xenobiologist
    • 15. Mai 2008 um 16:09
    Zitat von progandy

    Ist doch einfach :) :

    [autoit]

    $n = _getDOSOutput('rsm view /tphysical_media /b /cg178081F3FCB74242907808DC711B1CF1')
    $n2 = _getDOSOutput('rsm view /tpartition /b /cg' & $n)
    $nummer = _getDOSOutput('rsm view /tlogical_media /b /cg' & $n2)

    [/autoit]

    Genau so habe ich mir das gedacht. Warum du Probleme mit dem " " hattest weiß ich allerdings nicht. Wenn ich die Beta nutze, dann funzt die Func auch so.

    Mega

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™