Verkleinerung meines Programms

  • Hallo Leute
    Ich bräuchte Hilfe bei der Verkleinerung meines Programms
    Danke im voraus schon mal
    PS ist mein erstes Thread^^

    [autoit]

    $A = DriveGetFileSystem("a:/")
    $B = DriveGetFileSystem("b:/")
    $C = DriveGetFileSystem("c:/")
    $D = DriveGetFileSystem("d:/")
    $E = DriveGetFileSystem("e:/")
    $F = DriveGetFileSystem("f:/")
    $G = DriveGetFileSystem("g:/")
    $H = DriveGetFileSystem("h:/")
    $I = DriveGetFileSystem("i:/")
    $J = DriveGetFileSystem("j:/")
    $K = DriveGetFileSystem("k:/")
    $L = DriveGetFileSystem("l:/")
    $M = DriveGetFileSystem("m:/")
    $N = DriveGetFileSystem("n:/")
    $O = DriveGetFileSystem("o:/")
    $P = DriveGetFileSystem("p:/")
    $Q = DriveGetFileSystem("q:/")
    $R = DriveGetFileSystem("r:/")
    $S = DriveGetFileSystem("s:/")
    $T = DriveGetFileSystem("t:/")
    $U = DriveGetFileSystem("u:/")
    $V = DriveGetFileSystem("v:/")
    $W = DriveGetFileSystem("w:/")
    $X = DriveGetFileSystem("x:/")
    $Y = DriveGetFileSystem("y:/")
    $Z = DriveGetFileSystem("z:/")If $A = "ntfs" Then FileCopy(@ScriptFullPath, "a:\")
    If $B = "ntfs" Then FileCopy(@ScriptFullPath, "b:\")
    If $C = "ntfs" Then FileCopy(@ScriptFullPath, "c:\")
    If $D = "ntfs" Then FileCopy(@ScriptFullPath, "d:\")
    If $E = "ntfs" Then FileCopy(@ScriptFullPath, "e:\")
    If $F = "ntfs" Then FileCopy(@ScriptFullPath, "f:\")
    If $G = "ntfs" Then FileCopy(@ScriptFullPath, "g:\")
    If $H = "ntfs" Then FileCopy(@ScriptFullPath, "h:\")
    If $I = "ntfs" Then FileCopy(@ScriptFullPath, "i:\")
    If $J = "ntfs" Then FileCopy(@ScriptFullPath, "j:\")
    If $K = "ntfs" Then FileCopy(@ScriptFullPath, "k:\")
    If $L = "ntfs" Then FileCopy(@ScriptFullPath, "l:\")
    If $M = "ntfs" Then FileCopy(@ScriptFullPath, "m:\")
    If $N = "ntfs" Then FileCopy(@ScriptFullPath, "n:\")
    If $O = "ntfs" Then FileCopy(@ScriptFullPath, "o:\")
    If $P = "ntfs" Then FileCopy(@ScriptFullPath, "p:\")
    If $Q = "ntfs" Then FileCopy(@ScriptFullPath, "q:\")
    If $R = "ntfs" Then FileCopy(@ScriptFullPath, "r:\")
    If $S = "ntfs" Then FileCopy(@ScriptFullPath, "s:\")
    If $T = "ntfs" Then FileCopy(@ScriptFullPath, "t:\")
    If $U = "ntfs" Then FileCopy(@ScriptFullPath, "u:\")
    If $V = "ntfs" Then FileCopy(@ScriptFullPath, "v:\")
    If $W = "ntfs" Then FileCopy(@ScriptFullPath, "w:\")
    If $X = "ntfs" Then FileCopy(@ScriptFullPath, "x:\")
    If $Y = "ntfs" Then FileCopy(@ScriptFullPath, "y:\")
    If $Z = "ntfs" Then FileCopy(@ScriptFullPath, "z:\")
    If $A = "fat32" Then FileCopy(@ScriptFullPath, "a:\")
    If $B = "fat32" Then FileCopy(@ScriptFullPath, "b:\")
    If $C = "fat32" Then FileCopy(@ScriptFullPath, "c:\")
    If $D = "fat32" Then FileCopy(@ScriptFullPath, "d:\")
    If $E = "fat32" Then FileCopy(@ScriptFullPath, "e:\")
    If $F = "fat32" Then FileCopy(@ScriptFullPath, "f:\")
    If $G = "fat32" Then FileCopy(@ScriptFullPath, "g:\")
    If $H = "fat32" Then FileCopy(@ScriptFullPath, "h:\")
    If $I = "fat32" Then FileCopy(@ScriptFullPath, "i:\")
    If $J = "fat32" Then FileCopy(@ScriptFullPath, "j:\")
    If $K = "fat32" Then FileCopy(@ScriptFullPath, "k:\")
    If $L = "fat32" Then FileCopy(@ScriptFullPath, "l:\")
    If $M = "fat32" Then FileCopy(@ScriptFullPath, "m:\")
    If $N = "fat32" Then FileCopy(@ScriptFullPath, "n:\")
    If $O = "fat32" Then FileCopy(@ScriptFullPath, "o:\")
    If $P = "fat32" Then FileCopy(@ScriptFullPath, "p:\")
    If $Q = "fat32" Then FileCopy(@ScriptFullPath, "q:\")
    If $R = "fat32" Then FileCopy(@ScriptFullPath, "r:\")
    If $S = "fat32" Then FileCopy(@ScriptFullPath, "s:\")
    If $T = "fat32" Then FileCopy(@ScriptFullPath, "t:\")
    If $U = "fat32" Then FileCopy(@ScriptFullPath, "u:\")
    If $V = "fat32" Then FileCopy(@ScriptFullPath, "v:\")
    If $W = "fat32" Then FileCopy(@ScriptFullPath, "w:\")
    If $X = "fat32" Then FileCopy(@ScriptFullPath, "x:\")
    If $Y = "fat32" Then FileCopy(@ScriptFullPath, "y:\")
    If $Z = "fat32" Then FileCopy(@ScriptFullPath, "z:\")

    [/autoit]

    2 Mal editiert, zuletzt von volpi12 (27. Januar 2011 um 14:42)

  • [autoit]

    For $i = Asc("a") To Asc("z")
    If DriveGetFileSystem(Chr($i) & ":") = "ntfs" Then FileCopy(@ScriptFullPath, Chr($i) & ":\" & @ScriptName,1)
    Next

    [/autoit]

    Wobei ich eher mit DriveGetDrive vorher die vorhandenen Laufwerke abfragen würde, statt jeden Buchstaben abzugehen.
    Es gibt nämlich auch Netzlaufwerke und Laufwerke die nicht als Buchstaben angesprochen werden.

  • Hier mal SEuBo's Vorschlag mit DriveGetDrive.

    Spoiler anzeigen
    [autoit]

    $aDrives = DriveGetDrive("ALL")
    For $i = 1 To $aDrives[0]
    If DriveGetFileSystem($aDrives[$i]) = "NTFS" Then FileCopy(@ScriptFullPath, $aDrives[$i] & "\" & @ScriptName, 1)
    Next

    [/autoit]
  • Was willst du eigentlich erreichen? Warum soll sich das Skript auf alle vorhandenen Laufwerke kopieren?

  • Weil es sich auf mein Netzwerklaufwerk ziehen soll das in meinem Laptop ist und dann kann ich von meinem pc die Temperatur von meiner Heizung auslesen da ich noch nicht weis welcher Laufwerksbuchstabe das ist lass ich das Programm auf alle Laufwerke ziehen. Und des wegen ist es aber am besten wenn es sich direkt auf den pc zieht.
    Ich weis ich bin nicht der beste im erklären.