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

Beiträge von Micha_he

  • schauen ob seite offen ist

    • Micha_he
    • 10. Februar 2009 um 19:01

    na, das ist aber noch einfach oder ?

    Spoiler anzeigen
    [autoit]

    While 1
    If WinActive($title) Then
    sleep(1000)

    ElseIf WinActive($title2)Then
    Run()
    EndIf
    Wend

    [/autoit]
  • Dateien auf Ftp server hochladen

    • Micha_he
    • 10. Februar 2009 um 18:48

    Globale Variable für DllOpen (Zeile 1), DllOpen (Zeile 20) & DllClose (Zeile 210) fehlenden in dieser 'FTP.au3', die aber leider sehr oft verbreitet ist.

    Hier die geänderte Version der 'FTP.au3' mit der es klappen sollte:

    Spoiler anzeigen
    [autoit]

    Global $dll

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

    ;===============================================================================
    ;
    ; Function Name: _FTPOpen()
    ; Description: Opens an FTP session.
    ; Parameter(s): $s_Agent - Random name. ( like "myftp" )
    ; $l_AccessType - I dont got a clue what this does.
    ; $s_ProxyName - ProxyName.
    ; $s_ProxyBypass - ProxyByPasses's.
    ; $l_Flags - Special flags.
    ; Requirement(s): DllCall, wininet.dll
    ; Return Value(s): On Success - Returns an indentifier.
    ; On Failure - 0 and sets @ERROR
    ; Author(s): Wouter van Kesteren.
    ;
    ;===============================================================================

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

    Func _FTPOpen($s_Agent, $l_AccessType = 1, $s_ProxyName = '', $s_ProxyBypass = '', $l_Flags = 0)
    $dll = DllOpen("wininet.dll")
    Local $ai_InternetOpen = DllCall('wininet.dll', 'long', 'InternetOpen', 'str', $s_Agent, 'long', $l_AccessType, 'str', $s_ProxyName, 'str', $s_ProxyBypass, 'long', $l_Flags)
    If @error OR $ai_InternetOpen[0] = 0 Then
    SetError(-1)
    Return 0
    EndIf

    Return $ai_InternetOpen[0]

    EndFunc ;==> _FTPOpen()

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

    ;===============================================================================
    ;
    ; Function Name: _FTPConnect()
    ; Description: Connects to an FTP server.
    ; Parameter(s): $l_InternetSession - The Long from _FTPOpen()
    ; $s_ServerName - Server name/ip.
    ; $s_Username - Username.
    ; $s_Password - Password.
    ; $i_ServerPort - Server port ( 0 is default (21) )
    ; $l_Service - I dont got a clue what this does.
    ; $l_Flags - Special flags.
    ; $l_Context - I dont got a clue what this does.
    ; Requirement(s): DllCall, wininet.dll
    ; Return Value(s): On Success - Returns an indentifier.
    ; On Failure - 0 and sets @ERROR
    ; Author(s): Wouter van Kesteren
    ;
    ;===============================================================================

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

    Func _FTPConnect($l_InternetSession, $s_ServerName, $s_Username, $s_Password, $i_ServerPort = 0, $l_Service = 1, $l_Flags = 0, $l_Context = 0)

    Local $ai_InternetConnect = DllCall('wininet.dll', 'long', 'InternetConnect', 'long', $l_InternetSession, 'str', $s_ServerName, 'int', $i_ServerPort, 'str', $s_Username, 'str', $s_Password, 'long', $l_Service, 'long', $l_Flags, 'long', $l_Context)
    If @error OR $ai_InternetConnect[0] = 0 Then
    SetError(-1)
    Return 0
    EndIf

    Return $ai_InternetConnect[0]

    EndFunc ;==> _FTPConnect()

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

    ;===============================================================================
    ;
    ; Function Name: _FTPPutFile()
    ; Description: Puts an file on an FTP server.
    ; Parameter(s): $l_FTPSession - The Long from _FTPConnect()
    ; $s_LocalFile - The local file.
    ; $s_RemoteFile - The remote Location for the file.
    ; $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): Wouter van Kesteren
    ;
    ;===============================================================================

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

    Func _FTPPutFile($l_FTPSession, $s_LocalFile, $s_RemoteFile, $l_Flags = 0, $l_Context = 0)

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

    Local $ai_FTPPutFile = DllCall('wininet.dll', 'int', 'FtpPutFile', 'long', $l_FTPSession, 'str', $s_LocalFile, 'str', $s_RemoteFile, 'long', $l_Flags, 'long', $l_Context)
    If @error OR $ai_FTPPutFile[0] = 0 Then
    SetError(-1)
    Return 0
    EndIf

    Return $ai_FTPPutFile[0]

    EndFunc ;==> _FTPPutFile()

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

    ;===============================================================================
    ;
    ; Function Name: _FTPDelFile()
    ; Description: Delete an file from an FTP server.
    ; Parameter(s): $l_FTPSession - The Long from _FTPConnect()
    ; $s_RemoteFile - The remote Location for the file.
    ; Requirement(s): DllCall, wininet.dll
    ; Return Value(s): On Success - 1
    ; On Failure - 0
    ; Author(s): Wouter van Kesteren
    ;
    ;===============================================================================

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

    Func _FTPDelFile($l_FTPSession, $s_RemoteFile)

    Local $ai_FTPPutFile = DllCall('wininet.dll', 'int', 'FtpDeleteFile', 'long', $l_FTPSession, 'str', $s_RemoteFile)
    If @error OR $ai_FTPPutFile[0] = 0 Then
    SetError(-1)
    Return 0
    EndIf

    Return $ai_FTPPutFile[0]

    EndFunc ;==> _FTPDelFile()

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

    ;===============================================================================
    ;
    ; Function Name: _FTPRenameFile()
    ; Description: Renames an file on an FTP server.
    ; Parameter(s): $l_FTPSession - The Long from _FTPConnect()
    ; $s_Existing - The old file name.
    ; $s_New - The new file name.
    ; Requirement(s): DllCall, wininet.dll
    ; Return Value(s): On Success - 1
    ; On Failure - 0
    ; Author(s): Wouter van Kesteren
    ;
    ;===============================================================================

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

    Func _FTPRenameFile($l_FTPSession, $s_Existing, $s_New)

    Local $ai_FTPRenameFile = DllCall('wininet.dll', 'int', 'FtpRenameFile', 'long', $l_FTPSession, 'str', $s_Existing, 'str', $s_New)
    If @error OR $ai_FTPRenameFile[0] = 0 Then
    SetError(-1)
    Return 0
    EndIf

    Return $ai_FTPRenameFile[0]

    EndFunc ;==> _FTPRenameFile()

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

    ;===============================================================================
    ;
    ; 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
    ;
    ;===============================================================================

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

    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()

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

    ;===============================================================================
    ;
    ; Function Name: _FTPDelDir()
    ; Description: Delete's an Directory on an FTP server.
    ; Parameter(s): $l_FTPSession - The Long from _FTPConnect()
    ; $s_Remote - The Directory to be deleted.
    ; Requirement(s): DllCall, wininet.dll
    ; Return Value(s): On Success - 1
    ; On Failure - 0
    ; Author(s): Wouter van Kesteren
    ;
    ;===============================================================================

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

    Func _FTPDelDir($l_FTPSession, $s_Remote)

    Local $ai_FTPDelDir = DllCall('wininet.dll', 'int', 'FtpRemoveDirectory', 'long', $l_FTPSession, 'str', $s_Remote)
    If @error OR $ai_FTPDelDir[0] = 0 Then
    SetError(-1)
    Return 0
    EndIf

    Return $ai_FTPDelDir[0]

    EndFunc ;==> _FTPDelDir()

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

    ;===============================================================================
    ;
    ; Function Name: _FTPClose()
    ; Description: Closes the _FTPOpen session.
    ; Parameter(s): $l_InternetSession - The Long from _FTPOpen()
    ; Requirement(s): DllCall, wininet.dll
    ; Return Value(s): On Success - 1
    ; On Failure - 0
    ; Author(s): Wouter van Kesteren
    ;
    ;===============================================================================

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

    Func _FTPClose($l_InternetSession)

    Local $ai_InternetCloseHandle = DllCall('wininet.dll', 'int', 'InternetCloseHandle', 'long', $l_InternetSession)
    If @error OR $ai_InternetCloseHandle[0] = 0 Then
    SetError(-1)
    Return 0
    EndIf
    DllClose($dll)
    Return $ai_InternetCloseHandle[0]

    EndFunc ;==> _FTPClose()

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

    ; ================================================= FTP Functions for UDF ==========================================================

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

    Local Const $FTP_ASCII = 1
    Local Const $FTP_BINARY = 2
    Local Const $FTP_OVERWRITE = 0
    Local Const $FTP_DONTOVERWRIRE = -1
    Local Const $FTP_PASSIVE = 0x8000000
    Local Const $FTP_NONPASSIVE = 0

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

    ;===============================================================================

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

    ;
    ; Function Name: _FTPFileFindFirst()
    ; Description: Find First File on an FTP server.
    ; Parameter(s): $l_FTPSession - The Long from _FTPConnect()
    ; $s_RemoteFile - The remote Location for the file.
    ; $l_Flags - use the dwFlags parameter to specify 1 for transferring the file in ASCII (Type A transfer method) or 2 for transferring the file in Binary (Type I transfer method).
    ; $l_Context - lContext is used to identify the application context when using callbacks. Since we’re not using callbacks we’ll pass 0.
    ; Requirement(s): DllCall, wininet.dll
    ; Return Value(s): On Success - 1
    ; On Failure - 0
    ; Author(s): Dick Bronsdijk
    ;
    ;===============================================================================

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

    #cs
    typedef struct _WIN32_FIND_DATA {
    DWORD dwFileAttributes;
    FILETIME ftCreationTime;
    FILETIME ftLastAccessTime;
    FILETIME ftLastWriteTime;
    DWORD nFileSizeHigh;
    DWORD nFileSizeLow;
    DWORD dwReserved0;
    DWORD dwReserved1;
    TCHAR cFileName[MAX_PATH];
    TCHAR cAlternateFileName[14];
    } WIN32_FIND_DATA;
    typedef struct _FILETIME {
    DWORD dwLowDateTime;
    DWORD dwHighDateTime;
    } FILETIME;
    #ce
    Func _FTPFileFindFirst($l_FTPSession, $s_RemoteFile, ByRef $h_Handle, ByRef $l_DllStruct, $l_Flags = 0, $l_Context = 0)

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

    Local $str = "int;uint[2];uint[2];uint[2];int;int;int;int;char[256];char[14]"
    $l_DllStruct = DllStructCreate($str)
    if @error Then
    SetError(-2)
    Return ""
    endif

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

    Dim $a_FTPFileList[1]
    $a_FTPFileList[0] = 0

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

    Local $ai_FTPPutFile = DllCall('wininet.dll', 'int', 'FtpFindFirstFile', 'long', $l_FTPSession, 'str', $s_RemoteFile, 'ptr', DllStructGetPtr($l_DllStruct), 'long', $l_Flags, 'long', $l_Context)
    If @error OR $ai_FTPPutFile[0] = 0 Then
    SetError(-1)
    Return $a_FTPFileList
    EndIf
    $h_Handle = $ai_FTPPutFile[0]
    $FileName = DllStructGetData($l_DllStruct, 9)

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

    Dim $a_FTPFileList[12]
    $a_FTPFileList[0] = 12
    $a_FTPFileList[1] = DllStructGetData($l_DllStruct, 1) ; File Attributes
    $a_FTPFileList[2] = DllStructGetData($l_DllStruct, 2, 1) ; Creation Time Low
    $a_FTPFileList[3] = DllStructGetData($l_DllStruct, 2, 2) ; Creation Time High
    $a_FTPFileList[4] = DllStructGetData($l_DllStruct, 3, 1) ; Access Time Low
    $a_FTPFileList[5] = DllStructGetData($l_DllStruct, 3, 2) ; Access Time High
    $a_FTPFileList[6] = DllStructGetData($l_DllStruct, 4, 1) ; Last Write Low
    $a_FTPFileList[7] = DllStructGetData($l_DllStruct, 4, 2) ; Last Write High
    $a_FTPFileList[8] = DllStructGetData($l_DllStruct, 5) ; File Size High
    $a_FTPFileList[9] = DllStructGetData($l_DllStruct, 6) ; File Size Low
    $a_FTPFileList[10] = DllStructGetData($l_DllStruct, 9) ; File Name
    $a_FTPFileList[11] = DllStructGetData($l_DllStruct, 10) ; Altername

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

    Return $a_FTPFileList

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

    EndFunc;==> _FTPFileFindFirst()

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

    ;===============================================================================

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

    ;
    ; Function Name: _FTPFileFindNext()
    ; Description: Find Next File on an FTP server.
    ; Parameter(s): $l_FTPSession - The Long from _FTPConnect()
    ; $s_RemoteFile - The remote Location for the file.
    ; Requirement(s): DllCall, wininet.dll
    ; Return Value(s): On Success - 1
    ; On Failure - 0
    ; Author(s): Dick Bronsdijk
    ;
    ;===============================================================================

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

    Func _FTPFileFindNext($h_Handle, $l_DllStruct)

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

    Dim $a_FTPFileList[1]
    $a_FTPFileList[0] = 0

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

    Local $ai_FTPPutFile = DllCall('wininet.dll', 'int', 'InternetFindNextFile', 'long', $h_Handle, 'ptr', DllStructGetPtr($l_DllStruct))
    If @error OR $ai_FTPPutFile[0] = 0 Then
    SetError(-1)
    Return $a_FTPFileList
    EndIf

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

    Dim $a_FTPFileList[12]
    $a_FTPFileList[0] = 12
    $a_FTPFileList[1] = DllStructGetData($l_DllStruct, 1) ; File Attributes
    $a_FTPFileList[2] = DllStructGetData($l_DllStruct, 2, 1) ; Creation Time Low
    $a_FTPFileList[3] = DllStructGetData($l_DllStruct, 2, 2) ; Creation Time High
    $a_FTPFileList[4] = DllStructGetData($l_DllStruct, 3, 1) ; Access Time Low
    $a_FTPFileList[5] = DllStructGetData($l_DllStruct, 3, 2) ; Access Time High
    $a_FTPFileList[6] = DllStructGetData($l_DllStruct, 4, 1) ; Last Write Low
    $a_FTPFileList[7] = DllStructGetData($l_DllStruct, 4, 2) ; Last Write High
    $a_FTPFileList[8] = DllStructGetData($l_DllStruct, 5) ; File Size High
    $a_FTPFileList[9] = DllStructGetData($l_DllStruct, 6) ; File Size Low
    $a_FTPFileList[10] = DllStructGetData($l_DllStruct, 9) ; File Name
    $a_FTPFileList[11] = DllStructGetData($l_DllStruct, 10) ; Altername

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

    Return $a_FTPFileList

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

    EndFunc;==> _FTPFileFindNext()

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

    ;===============================================================================

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

    ;
    ; Function Name: _FTPFileFindClose()
    ; Description: Delete FindFile Structure.
    ; Parameter(s):
    ; Requirement(s): DllCall, wininet.dll
    ; Return Value(s): On Success - 1
    ; On Failure - 0
    ; Author(s): Dick Bronsdijk
    ;
    ;===============================================================================

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

    Func _FTPFileFindClose($h_Handle, $l_DllStruct)

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

    ;~ DllStructDelete($l_DllStruct)

    Local $ai_FTPPutFile = DllCall('wininet.dll', 'int', 'InternetCloseHandle', 'long', $h_Handle)
    If @error OR $ai_FTPPutFile[0] = 0 Then
    SetError(-1)
    Return ""
    EndIf

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

    Return $ai_FTPPutFile[0]

    EndFunc;==> _FTPFileFindClose()

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

    ;===============================================================================
    ;
    ; Function Name: _FTPGetFile() - db Test
    ; Description: Gets an file from an FTP server.
    ; Parameter(s): $l_FTPSession - The Long from _FTPConnect()
    ; $s_RemoteFile - The remote Location for the file.
    ; $s_LocalFile - The local file.
    ; $l_Flags - use the dwFlags parameter to specify
    ; - 1 for transferring the file in ASCII (Type A transfer method) or
    ; - 2 for transferring the file in Binary (Type I transfer method).
    ; $l_Fail - Allow local file to be overwritten if it exists
    ; - -1 Don't allow overwrite (default)
    ; - 0 Allow overwrite
    ; $l_Attributes - Attributes for local file
    ; $l_Context - lContext is used to identify the application context when using callbacks. Since we’re not using callbacks we’ll pass 0.
    ; Requirement(s): DllCall, wininet.dll
    ; Return Value(s): On Success - 1
    ; On Failure - 0
    ; Author(s): Dick Bronsdijk
    ;
    ;===============================================================================

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

    Func _FTPGetFile($l_FTPSession, $s_RemoteFile, $s_LocalFile, $l_Flags = 2, $l_Fail = -1, $l_Attributes = 0, $l_Context = 0)

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

    Local $ai_FTPGetFile = DllCall('wininet.dll', 'int', 'FtpGetFile', 'long', $l_FTPSession, 'str', $s_RemoteFile, 'str', $s_LocalFile, 'long', $l_Fail, 'long', $l_Attributes, 'long', $l_Flags, 'long', $l_Context)
    If @error OR $ai_FTPGetFile[0] = 0 Then
    SetError(-1)
    Return 0
    EndIf

    Return $ai_FTPGetFile[0]

    EndFunc;==> _FTPGetFile()

    [/autoit]
  • Dateien auf Ftp server hochladen

    • Micha_he
    • 10. Februar 2009 um 18:04

    Mit welcher FTP.au3 arbeitest Du. Soweit ich weis, gibt es mehrere.
    Unter Umständen solltest Du sie noch mit hochladen...

  • Access 2007 Problem

    • Micha_he
    • 9. Februar 2009 um 23:19

    Ich benutze folgende UDF um auf eine Access2000-MDB zuzugreifen...

    Spoiler anzeigen
    [autoit]

    ;AccessCOM.au3 0_28
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
    #region Main
    #include-once
    #include <Misc.au3>
    #include <File.au3>
    #include <Date.au3>
    #include <GuiConstants.au3>
    #include <GuiListView.au3>
    Global $formatT = "Text(50)", $formatD = "Date", $data2 = @MON & "/" & @MDAY & "/" & StringRight(@YEAR, 2)
    ;global $hndListView_Array1Box_Display = GUICtrlCreateListView($sTemp, 0, 16, $Width, $Height - 40, $LVS_SHOWSELALWAYS, BitOR($LVS_EX_GRIDLINES, $LVS_EX_HEADERDRAGDROP, $LVS_EX_FULLROWSELECT, $LVS_EX_REGIONAL))
    #endregion Main
    Func _CreateDB($s_dbname, $USRName = "", $PWD = "")
    $newMdb = ObjCreate("ADOX.Catalog");
    $newMdb.Create ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $s_dbname & ';')
    ;~ $newMdb.Create ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&$s_dbname&';UID=' & $USRName & ';PWD=' & $PWD)
    ;~ $newMdb.Create ("Driver={Microsoft Access Driver (*.mdb)};Dbq="&$s_dbname&';UID=' & $USRName & ';PWD=' & $PWD)
    $newmdb.ActiveConnection.Close
    ;$newmdb.Close
    EndFunc ;==>_CreateDB
    Func _ExecuteMDB($s_dbname, $addConn, $sQuery, $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsObj($addConn) Then
    _AccessConnectConn($s_dbname, $addConn, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    Return $addConn.execute ($sQuery)
    EndFunc ;==>_ExecuteMDB
    Func _CopyTableToDB($s_dbname, $s_Tablename, $sNewDB, ByRef $addConn, ByRef $addConn2, $i_adoMDB = 1, $USRName = "", $PWD = "");(byref $sDB1, $sDbTable1, $sNewTable,$i_Execute=1)
    If Not IsObj($addConn) Then
    _AccessConnectConn($s_dbname, $addConn, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    If Not IsObj($addConn2) Then
    _AccessConnectConn($sNewDB, $addConn2, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 2
    Else
    $i_NeedToCloseInFunc = 3
    EndIf
    If _TableExists($addConn2, $sNewDB, $s_Tablename) Then _DropTable($sNewDB, $s_Tablename, $addConn2)
    _AccessCloseConn($addConn2)
    ;COPY========================================================
    $queryCommand = "SELECT * INTO " & $s_Tablename & " IN '" & $sNewDB & "' FROM " & $s_Tablename;&" IN '" & $s_dbname &"'"
    $addConn.Execute ($queryCommand)
    ;CRHANGE2========================================================
    _AccessConnectConn($sNewDB, $addConn2, 0)
    If $i_NeedToCloseInFunc = 1 Then $addConn.Close
    If $i_NeedToCloseInFunc = 2 Then $addConn2.Close
    EndFunc ;==>_CopyTableToDB
    Func _CopyTableInDB($s_dbname, $s_Tablename, $sNewTable, ByRef $addConn, $i_adoMDB = 1, $USRName = "", $PWD = "");(byref $sDB1, $sDbTable1, $sNewTable,$i_Execute=1)
    If Not IsObj($addConn) Then
    _AccessConnectConn($s_dbname, $addConn, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    If _TableExists($addConn, $s_dbname, $sNewTable) Then _DropTable($s_dbname, $sNewTable, $addConn)
    ;COPY========================================================
    $queryCommand = "SELECT * INTO " & $sNewTable & " IN '" & $s_dbname & "' FROM " & $s_Tablename;&" IN '" & $s_dbname &"'"
    $addConn.Execute ($queryCommand)
    ;CRHANGE2========================================================
    If $i_NeedToCloseInFunc Then $addConn.Close
    EndFunc ;==>_CopyTableInDB
    Func _FieldNames($s_dbname, $s_Tablename, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsObj($o_adoCon) Then
    _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    $o_adoRs = ObjCreate("ADODB.Recordset")
    $o_adoRs.Open ("SELECT * FROM " & $s_Tablename, $o_adoCon)
    $name = ""
    For $i = 1 To $o_adoRs.Fields.Count
    $name = $name & $o_adoRs.Fields ($i - 1).Name & "|"
    Next
    $o_adoRs.Close
    If $i_NeedToCloseInFunc Then $o_adoCon.Close
    Return StringTrimRight($name, 1)
    EndFunc ;==>_FieldNames
    Func _GetFieldNames($s_dbname, $s_Tablename, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsObj($o_adoCon) Then
    _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    Dim $ret[1]
    $o_adoRs = ObjCreate("ADODB.Recordset")
    $o_adoRs.Open ("SELECT * FROM " & $s_Tablename, $o_adoCon)
    $name = ""
    For $i = 1 To $o_adoRs.Fields.Count
    ;$name = $name & $o_adoRs.Fields ($i - 1).Name & @CRLF
    ReDim $ret[UBound($ret, 1) + 1]
    $ret[UBound($ret, 1) - 1] = $o_adoRs.Fields ($i - 1).Name
    Next
    $o_adoRs.Close
    If $i_NeedToCloseInFunc Then $o_adoCon.Close
    Return $ret
    EndFunc ;==>_GetFieldNames
    Func _TableExists(ByRef $connectionobj, $s_dbname, $s_Table, $i_adoMDB = 1, $USRName = "", $PWD = "")
    Local $i_Exists
    $ar_GetTables = _GetTableNames($connectionobj, $s_dbname, $i_adoMDB, $USRName, $PWD)
    ;_ArrayDisplay($ar_GetTables,"")
    For $table In $ar_GetTables
    If $table = $s_Table Then $i_Exists = 1
    Next
    ;MsgBox(0,"",$i_Exists)
    Return $i_Exists
    EndFunc ;==>_TableExists
    Func _FieldExists(ByRef $connectionobj, $s_Tablename, $s_Fieldname, $i_adoMDB = 1, $USRName = "", $PWD = "")
    Local $i_Exists
    $ar_GetFields = _GetFieldNames($connectionobj, $s_Tablename, $i_adoMDB, $USRName, $PWD)
    For $field In $ar_GetFields
    If $field = $s_Fieldname Then $i_Exists = 1
    Next
    Return $i_Exists
    EndFunc ;==>_FieldExists
    Func _GetTableNames(ByRef $connectionobj, $s_dbname, $i_adoMDB = 1, $USRName = "", $PWD = "")
    Dim $ret[1]
    If IsObj($connectionobj) Then
    $adoxConn = ObjCreate("ADOX.Catalog")
    $adoxConn.activeConnection = $connectionobj
    For $table In $adoxConn.tables
    If $table.type = "TABLE" Then
    ReDim $ret[UBound($ret, 1) + 1]
    $ret[UBound($ret, 1) - 1] = $table.name
    EndIf
    Next
    ;$adoxConn.activeConnection.close
    ;$adoxConn = ""
    ;if not isobj($connectionobj) then
    ;$connectionobj=_AccessConnectConn($s_dbname, $connectionobj,$i_adoMDB,$USRName,$PWD)
    ;EndIf
    EndIf
    Return $ret
    EndFunc ;==>_GetTableNames
    Func _CreateTable($s_dbname, $s_Tablename, ByRef $addConn, $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsObj($addConn) Then
    _AccessConnectConn($s_dbname, $addConn, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    $addConn.Execute ("CREATE TABLE " & $s_Tablename)
    If $i_NeedToCloseInFunc Then $addConn.Close
    EndFunc ;==>_CreateTable
    Func _DropTable($s_dbname, $s_Tablename, ByRef $addConn, $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsObj($addConn) Then
    _AccessConnectConn($s_dbname, $addConn, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    $addConn.Execute ("DROP TABLE " & $s_Tablename)
    If $i_NeedToCloseInFunc Then $addConn.Close
    EndFunc ;==>_DropTable
    Func _CreateField($s_dbname, $s_Tablename, $s_Fieldname, $format, ByRef $addField, $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsObj($addField) Then
    _AccessConnectConn($s_dbname, $addField, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    ;if not _FieldExists($addField, $s_Tablename, $s_Fieldname) then
    $addField.Execute ("ALTER TABLE " & $s_Tablename & " ADD " & $s_Fieldname & " " & $format)
    If $i_NeedToCloseInFunc Then $addField.Close
    EndFunc ;==>_CreateField
    Func _AddData($s_dbname, $s_Tablename, $s_Fieldname, $s_i_value, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsObj($o_adoCon) Then
    _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    $o_adoRs = ObjCreate("ADODB.Recordset")
    $o_adoRs.CursorType = 1
    $o_adoRs.LockType = 3
    $o_adoRs.Open ("SELECT * FROM " & $s_Tablename, $o_adoCon)
    ;~ MsgBox(0, "_AddData", "$o_adoRs.Recordcount=" & $o_adoRs.RecordCount+1)
    $o_adoRs.AddNew
    ;~ $o_adoRs.Fields ("ROWID").Value = $o_adoRs.RecordCount+1
    $o_adoRs.Fields ($s_Fieldname).Value = $s_i_value
    $o_adoRs.Update
    $o_adoRs.Close
    If $i_NeedToCloseInFunc Then $o_adoCon.Close
    EndFunc ;==>_AddData
    Func _ReadOneField($q_sql, $s_dbname, $s_field, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "")
    Local $_output
    If Not IsObj($o_adoCon) Then
    _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    $o_adoRs = ObjCreate("ADODB.Recordset")
    $o_adoRs.CursorType = 1
    $o_adoRs.LockType = 3
    $o_adoRs.Open ($q_sql, $o_adoCon)
    With $o_adoRs
    If .RecordCount Then
    While Not .EOF
    $_output = $_output & .Fields ($s_field).Value & @CRLF
    .MoveNext
    WEnd
    EndIf
    EndWith
    $o_adoRs.Close
    If $i_NeedToCloseInFunc Then $o_adoCon.Close
    Return $_output
    EndFunc ;==>_ReadOneField
    Func _AddEntireRecord($s_dbname, $s_Tablename1, $ar_array, ByRef $o_adoCon, $ar_FieldFormatsF = "", $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsObj($o_adoCon) Then
    _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    $o_adoRs = ObjCreate("ADODB.Recordset")
    $o_adoRs.CursorType = 1
    $o_adoRs.LockType = 3
    $o_adoRs.Open ("SELECT * FROM " & $s_Tablename1, $o_adoCon)
    $records = $ar_array[0][0]
    $records = UBound($ar_array) - 1
    For $i = 1 To $records
    $o_adoRs.AddNew
    For $x = 1 To UBound($ar_array, 2) - 1
    $o_adoRs.Fields ($x - 1).Value = $ar_array[$i][$x]
    Next
    ;~ $o_adoRs.Fields ("ROWID").Value = $o_adoRs.RecordCount+1
    $o_adoRs.Update
    Next
    $o_adoRs.Close
    If $i_NeedToCloseInFunc Then $o_adoCon.Close
    EndFunc ;==>_AddEntireRecord
    Func _AddRecord($s_dbname, $s_Tablename1, $ar_array, ByRef $o_adoCon, $ar_FieldFormatsF = "", $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsArray($ar_array) And StringInStr($ar_array, "|") > 0 Then
    ;~ ConsoleWrite("not IsArray($ar_array) and StringInStr($ar_array,|)>0" & @LF)
    $ar_arraylocal = StringSplit($ar_array, "|")
    ;~ _ArrayDelete($ar_arraylocal,0)
    $ar_array = $ar_arraylocal
    ElseIf Not IsArray($ar_array) Then
    Local $ar_arraylocal[2]
    $ar_arraylocal[1] = $ar_array
    $ar_array = $ar_arraylocal
    EndIf
    If Not IsObj($o_adoCon) Then
    _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    $o_adoRs = ObjCreate("ADODB.Recordset")
    $o_adoRs.CursorType = 1
    $o_adoRs.LockType = 3
    $o_adoRs.Open ("SELECT * FROM " & $s_Tablename1, $o_adoCon)
    ;~ MsgBox(0, "_AddRecord", "$o_adoRs.Recordcount=" & $o_adoRs.RecordCount+1)
    $o_adoRs.AddNew
    ;~ $o_adoRs.Fields ("ROWID").Value = $o_adoRs.RecordCount+1
    For $x = 1 To UBound($ar_array) - 1
    $o_adoRs.Fields ($x - 1).Value = $ar_array[$x]
    Next
    $o_adoRs.Update
    $o_adoRs.Close
    If $i_NeedToCloseInFunc Then $o_adoCon.Close
    EndFunc ;==>_AddRecord
    Func _DeleteRecord($s_dbname, $s_Tablename1, $i_DeleteCount, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsObj($o_adoCon) Then
    _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    $o_adoRs = ObjCreate("ADODB.Recordset")
    $o_adoRs.CursorType = 1
    $o_adoRs.LockType = 3
    Local $a = 1
    $o_adoRs.Open ("SELECT * FROM " & $s_Tablename1, $o_adoCon)
    With $o_adoRs
    If .RecordCount Then
    .MoveFirst
    ;~ MsgBox(0, "_DeleteRecord", "$o_adoRs.RecordCount=" & $o_adoRs.RecordCount+1)
    While Not .EOF
    If $a = $i_DeleteCount Then
    .delete
    ExitLoop
    EndIf
    .MoveNext
    $a += 1
    WEnd
    EndIf
    EndWith
    $o_adoRs.Update
    $o_adoRs.Close
    If $i_NeedToCloseInFunc Then $o_adoCon.Close
    EndFunc ;==>_DeleteRecord
    Func MyErrFunc()
    ;#cs
    $HexNumber = Hex($oMyError.number, 8)
    MsgBox(0, "AutoItCOM Test", "We intercepted a COM Error !" & @CRLF & @CRLF & _
    "err.description is: " & @TAB & $oMyError.description & @CRLF & _
    "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
    "err.number is: " & @TAB & $HexNumber & @CRLF & _
    "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
    "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
    "err.source is: " & @TAB & $oMyError.source & @CRLF & _
    "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
    "err.helpcontext is: " & @TAB & $oMyError.helpcontext _
    )
    ;#ce
    SetError(1) ; to check for after this function returns
    EndFunc ;==>MyErrFunc
    Func _CountTables(ByRef $connectionobj, $s_dbname, $i_adoMDB = 1, $USRName = "", $PWD = "")
    $ar_GetTables = _GetTableNames($connectionobj, $s_dbname, $i_adoMDB, $USRName, $PWD)
    Return UBound($ar_GetTables) - 1
    EndFunc ;==>_CountTables
    Func _ArrayViewQueryTable($ar_Rows, $s_Table)
    _2dArrayDisp($ar_Rows, $s_Table)
    ;~ _ArrayView2D1D($ar_Rows,$s_Table&"$s_Tablename Array")
    ;~ _ArrayViewText($ar_Rows,$s_Table,1,1,1,0,800,600,-1,-1);,$Displayindex=1, $ZeroRowAsHeader=0)
    EndFunc ;==>_ArrayViewQueryTable
    Func _AccessConnectConn($s_dbname, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "")
    ;MsgBox(0, "$USRName/$PWD", $USRName&@lf&$PWD)
    $o_adoCon = ObjCreate("ADODB.Connection")
    If Not $i_adoMDB Then $o_adoCon.Open ("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $s_dbname & ";User Id=" & $USRName & ";Password=" & $PWD & ";")
    If $i_adoMDB Then $o_adoCon.Open ("Driver={Microsoft Access Driver (*.mdb)};Dbq=" & $s_dbname & ';UID=' & $USRName & ';PWD=' & $PWD)
    Return $o_adoCon
    EndFunc ;==>_AccessConnectConn
    Func _AccessCloseConn($o_adoCon)
    $o_adoCon.Close
    EndFunc ;==>_AccessCloseConn
    Func _RecordSearch($s_dbname, $_query, ByRef $o_adoCon, $i_adoMDB = 1, $USRName = "", $PWD = "")
    If Not IsObj($o_adoCon) Then
    _AccessConnectConn($s_dbname, $o_adoCon, $i_adoMDB, $USRName, $PWD)
    $i_NeedToCloseInFunc = 1
    Else
    $i_NeedToCloseInFunc = 0
    EndIf
    $o_adoRs = ObjCreate("ADODB.Recordset")
    $o_adoRs.CursorType = 1
    $o_adoRs.LockType = 3
    $o_adoRs.Open ($_query, $o_adoCon)
    With $o_adoRs
    Dim $_output[.RecordCount + 1][.Fields.Count + 1]
    $_output[0][0] = .RecordCount
    For $i = 1 To .Fields.Count
    $_output[0][$i] = .Fields ($i - 1).Name
    Next
    If $o_adoRs.RecordCount Then
    $z = 0
    While Not .EOF
    $z = $z + 1
    For $x = 1 To .Fields.Count
    $_output[$z][$x] = .Fields ($x - 1).Value
    Next
    .MoveNext
    WEnd
    EndIf
    EndWith
    $o_adoRs.Close
    If $i_NeedToCloseInFunc Then $o_adoCon.Close
    Return $_output
    EndFunc ;==>_RecordSearch
    Func _2dArrayDisp($ar_array, $s_Label = "Display")
    $report = "Number of records matching = " & UBound($ar_array) - 1 & @CRLF
    For $x = 1 To UBound($ar_array) - 1
    For $i = 1 To UBound($ar_array, 2) - 1
    $report = $report & $ar_array[$x][$i] & "|"
    Next
    $report = StringTrimRight($report, 1) & @CRLF
    Next
    MsgBox(0, $s_Label, $report)
    EndFunc ;==>_2dArrayDisp

    [/autoit]

    Hier noch mein Geburtstags-Melder als Demo:

    Spoiler anzeigen
    [autoit]

    ; Geburtstage.au3
    ; Version 1.03
    ; von Michael Schröder

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

    #include"AccessCOM.au3"
    #include"date.au3"

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

    Local $o_Con
    Local $s_dbname = @ScriptDir & "\daten.mdb"
    Local $s_Tablename = "Geburtstage"
    dim $tag [4]
    dim $monat [4]
    dim $report = "Niemand !" & @CRLF

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

    If Not FileExists($s_dbname) Then
    MsgBox(0, "", "Datenbank existiert nicht")
    exit
    Else
    $tag[0] = StringFormat("%d",StringMid(_NowCalcDate(),9,2))
    $tag[1] = StringFormat("%d",StringMid(_dateAdd("D",1,_NowCalcDate()),9,2))
    $tag[2] = StringFormat("%d",StringMid(_dateAdd("D",2,_NowCalcDate()),9,2))
    $tag[3] = StringFormat("%d",StringMid(_dateAdd("D",3,_NowCalcDate()),9,2))
    $monat[0] = StringFormat("%d",StringMid(_NowCalcDate(),6,2))
    $monat[1] = StringFormat("%d",StringMid(_dateAdd("D",1,_NowCalcDate()),6,2))
    $monat[2] = StringFormat("%d",StringMid(_dateAdd("D",2,_NowCalcDate()),6,2))
    $monat[3] = StringFormat("%d",StringMid(_dateAdd("D",3,_NowCalcDate()),6,2))
    _AccessConnectConn ($s_dbname, $o_Con, 0)
    $query = "SELECT * FROM " & $s_Tablename & " WHERE Month([Datum])='" & $monat[0] & "' AND Day([Datum])='" & $tag[0] & "' OR Month([Datum])='" & $monat[1] & "' AND Day([Datum])='" & $tag[1] & "' OR Month([Datum])='" & $monat[2] & "' AND Day([Datum])='" & $tag[2] & "' OR Month([Datum])='" & $monat[3] & "' AND Day([Datum])='" & $tag[3] & "'"
    $ar_Rows = _RecordSearch ($s_dbname, $query, $o_Con)
    if UBound($ar_rows) > 1 then
    $report = ""
    For $x = 1 To UBound($ar_rows) - 1
    $report = $report & StringMid($ar_rows[$x][3],7,2) & "." & StringMid($ar_rows[$x][3],5,2) & "." & StringMid($ar_rows[$x][3],1,4) & " - " & $ar_rows[$x][2] & " ( " & StringMid(_NowCalcDate(),1,4) - StringMid($ar_rows[$x][3],1,4) & " Jahre )" & @CRLF
    Next
    endif

    $tag[0] = StringFormat("%d",StringMid(_dateAdd("D",-1,_NowCalcDate()),9,2))
    $tag[1] = StringFormat("%d",StringMid(_dateAdd("D",-2,_NowCalcDate()),9,2))
    $monat[0] = StringFormat("%d",StringMid(_dateAdd("D",-1,_NowCalcDate()),6,2))
    $monat[1] = StringFormat("%d",StringMid(_dateAdd("D",-2,_NowCalcDate()),6,2))
    $query = "SELECT * FROM " & $s_Tablename & " WHERE Month([Datum])='" & $monat[0] & "' AND Day([Datum])='" & $tag[0] & "' OR Month([Datum])='" & $monat[1] & "' AND Day([Datum])='" & $tag[1] & "'"
    $ar_Rows = _RecordSearch ($s_dbname, $query, $o_Con)
    if UBound($ar_rows) > 1 then
    $report = $report & @CRLF & @CRLF & "und (vor-)gestern hatten..." & @CRLF & @CRLF
    For $x = 1 To UBound($ar_rows) - 1
    $report = $report & StringMid($ar_rows[$x][3],7,2) & "." & StringMid($ar_rows[$x][3],5,2) & "." & StringMid($ar_rows[$x][3],1,4) & " - " & $ar_rows[$x][2] & " ( " & StringMid(_NowCalcDate(),1,4) - StringMid($ar_rows[$x][3],1,4) & " Jahre )" & @CRLF
    Next
    endif

    if $report <> "Niemand !" & @CRLF then MsgBox(64, "Geburtstag haben...", $report)
    _AccessCloseConn ($o_Con)
    endif

    [/autoit]
  • Manage USB-Drives per devcon.exe

    • Micha_he
    • 9. Februar 2009 um 16:08

    eukalyptus:

    Ich habe mir Deine WMI-Version jetzt nicht extra angesehen.

    Nur einen Tip den ich beim Arbeiten mit WMI feststellen musste:
    Nicht alle WMI-Abfragen dürfen auch "Normalsterbliche"-User durchführen.
    Einiges ist den Admins vorbehalten. Also immer schön als Nicht-Admin testen.

    Aber wie gesagt, muss bei Deinem Script nicht zutreffen.

  • Manage USB-Drives per devcon.exe

    • Micha_he
    • 8. Februar 2009 um 19:04

    Der Start des Tools geht jetzt und wenn ein USB-Stick vorhanden ist, wird er auch angezeigt.

    Klicke ich jetzt nochmal auf Scan kommte folgende Meldung:
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Wähle ich dagegen meinen USB-Stick aus und klicke auf Entfernen, erscheint folgender Fehler:
    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

  • Zeilenumbrüche aus der Ablage entfernen

    • Micha_he
    • 8. Februar 2009 um 16:46

    ggf. so....

    Spoiler anzeigen
    [autoit]

    While 1
    $text = ClipGet()
    If $text <> "" And $text <> $textalt Then
    $text = StringReplace($text,@CRLF,"")
    ClipPut($text)
    $textalt = $text
    $text = ""
    EndIf
    Sleep(100)
    Wend

    [/autoit]

    Nur ob das parktikabel ist, bleibt offen. Das Script ersetzt nun STÄNDIG als Zeilevorschübe in der Zwischenbalage. Egal woher !

  • Manage USB-Drives per devcon.exe

    • Micha_he
    • 8. Februar 2009 um 16:24

    Vielleicht habe ich mich nicht verständlich genug ausgedrückt.

    Dein Script sammelt in Zeile 120 'REMOVEABLE' Drives, dazu zählen bei mir auch Floppy A und eine virtuelle Floppy B.
    Nun durchläuft das Script das Array ( Zeilen 122-139) und steigt gleich bei Floppy A aus weil das StringBetween kein gültiges Array liefert.
    Ändere ich die For-Schleife ab (Zeile 122: For $i = 3 ...) dann scheint es auch bei mir zu laufen.

    Gruß
    micha_he

  • Manage USB-Drives per devcon.exe

    • Micha_he
    • 8. Februar 2009 um 15:30

    Habe den gleichen Fehler wie Alina. Muss dazu sagen: Bei mir läuft noch AutoIt 3.2.10.0.
    Aber damit scheint es nichts zu tun zu haben.

    Sondern das Auslesen der Registry gibt nichts brauchbares zurück.
    Die Variable $val hat bei mir in Zeile 131 folgenden Inhalt:
    '\??\FDC#GENERIC_FLOPPY_DRIVE#5&2ded1349&0&0#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}'

    Damit gibts das StringBetween anschließend keine Array zurück.
    Denn die Strings 'Media#' und '&RM#' sind ja nicht enthalten.

    Edit: Es ist der erste Schleifendurchlauf, wo es mein Floppy-LW A findet !

  • Dateien Per TCP verschiken

    • Micha_he
    • 2. Februar 2009 um 17:05

    DJ Basslord (Edit: ggf. auch GTA Spider) hat mal geschrieben. AutoIt.de-Suche >> _TCPSendFile

    Edit: Na gut die streiten sich. Irgendwer hat es eben geschrieben und ich habe es gefunden & genutzt.

  • VGA Kanal überwachen

    • Micha_he
    • 1. Februar 2009 um 22:00

    Das ist nicht nur unter AutoIt nicht (oder sehr schwer) möglich !

    Wie soll man z.B. am VGA-Port messen/ermitteln können, ob extern das Signal ein zweites mal von einem Operationsverstärker-Eingang gelesen wird ?

    Der Eingang des OP ist so hochohmig, das sich das Signal nur ganz minimal verändert....

  • Idee + kann man das überhaupt?? Delete Files

    • Micha_he
    • 1. Februar 2009 um 00:28
    Zitat von Padmak

    wenn du das ganze dann kompilierst und per batch/cmd aufrufst
    z.b.

    Code
    cmdline.exe /param1 /param2 /param3 /paramn

    Padmak

    wohl doch eher:

    Code
    cmdline.exe param1 param2 param3 paramN

    ohne die "/"

  • Idee + kann man das überhaupt?? Delete Files

    • Micha_he
    • 1. Februar 2009 um 00:25
    Zitat von Blackdragon_860

    ja aber welchen parameter??

    http://de.wikipedia.org/wiki/Kommandozeilenparameter

  • Update Funktion: Prüfung wird nicht durchgeführt

    • Micha_he
    • 31. Januar 2009 um 23:42

    ggf:

    [autoit]


    InetGet("http://Serveradresse.de/update/" & $Line & ".exe", @TempDir & "\Filename.exe", 1, 0)
    ^

    [/autoit]

    Und bei Dir wird die EXE wahrscheinlich ähnlich wie "1.1 Final.exe" heißen. Unter Umständen musst du bei enthaltenen Leerzeichen ' " " ' schreiben.
    Also z.B.:

    [autoit]


    InetGet('"http://Serveradresse.de/update/' & $Line & '.exe"', @TempDir & "\Filename.exe", 1, 0)
    ^

    [/autoit]
  • Skriptbeispiel Spielkarten

    • Micha_he
    • 31. Januar 2009 um 23:23
    Zitat von Jam00

    Is echt interesant :thumbup:
    Naja, wenn sie nicht dabei ist, liehfert man sie eben mit!

    Was lizenztechnisch ein Problem darstellt, wenn man das Script dann mit DLL weitergibt. Immer drauf achten : Auch die DLL's von MS sind keine Freeware !

  • Anzahl von Zeicher herausfinden

    • Micha_he
    • 31. Januar 2009 um 23:19

    Der Befehl heißt wie fast in jeder Sprache StringLen().

    Irgendwas mit 'Len' heißt der Befehl in fast jeder Sprache und wenn man mit diesem Suchbegriff mal die AutoIt-Hilfe bemüht....

  • BMP zu JPG?

    • Micha_he
    • 31. Januar 2009 um 17:46

    mit Hilfe von IrfanView ? :

    [autoit]

    RunWait("i_view32.exe bild.bmp /convert=bildneu.jpg")

    [/autoit]
  • Ftp.au3

    • Micha_he
    • 31. Januar 2009 um 15:09
    Zitat von Padmak

    ...aber das sollte ich auch allein hinkriegen
    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Roggan« (Gestern, 01:02)

    Zitat


    Gestern, 15:07
    von: Padmak

    kein Kommentar !

  • Ftp.au3

    • Micha_he
    • 30. Januar 2009 um 18:36
    Zitat von Padmak

    darauf könnte man auch selbst kommen!!

    Padmak

    Wollte er doch. Er hat doch zu diesem Problem gar nicht gefragt !

  • Problem mit do...until Schleife

    • Micha_he
    • 29. Januar 2009 um 23:14

    Statt

    [autoit]

    until $i = $rounds

    [/autoit]

    musst Du

    [autoit]

    GUICtrlRead($rounds)

    [/autoit]

    schreiben, da in $rounds die Ctrl-ID abgelegt ist und nicht die Eingabe im Inputfeld.

    Edit: Wieder nur zweiter :)

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™