Hallo Gemeinde
Ich habe in den letzten tagen dank der tollen Hilfe dieses Forums einen script erstellt der mir alles Platten durchsucht, mir die gesamten Verzeichnise in einer Textdatei auf der jeweiligen Platte ausgibt und eine weitere Textdatei erstellt iin der er mir die Space daten ausgibt.
ich möchte allerdings erreichen das das Script nur .rar files, .mp3 files, .jpg files in jeweils einer Textdatei ausgibt, aber wüsste jetzt nicht wie ich das entstandene Array diesen Parametern entsprechend durchsuchen / manipulieren könnte.
villeicht könnt ihr mir helfen Danke
Script :
Spoiler anzeigen
;Von Kenngott Marco (Eistee, AsusExcite)
;E-Mail : [email='marco.kenngott@live.de'][/email]
;
;
#include <Array.au3>
#include <File.au3>
Global $dRives
Global $dRives2
Global $dRivespace
Global $dRivespace2
Global $dRivespaceB
Global $dRivespace2B
Global $dRivespaceC
Global $dRivespace2C
Global $dRivespaceD
Global $dRivespace2D
Global $iA
$dRives = DriveGetDrive("fixed")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]If Not @error Then
For $iA = 1 To $dRives[0]
Next
EndIf
For $iA = 1 To $dRives[0]
_FileListCreate()
_FileSpaceData()
;MsgBox(1,"Laufwerke ausser C:\ Nr." & $iA, $dRives[$iA])
Next
Func _FileSpaceData()
$dRivespace = DriveSpaceFree($dRives[$iA] & "\")
$dRivespace2 = DriveSpaceTotal($dRives[$iA] & "\")
$dRivespaceB = StringSplit($dRivespace, ".")
$dRivespace2B = StringSplit($dRivespace2, ".")
$dRivespaceC = $dRivespaceB[1] / 1000
$dRivespace2C = $dRivespace2B[1] / 1000
$dRivespaceD = StringSplit($dRivespaceC, ".")
$dRivespace2D = StringSplit($dRivespace2C, ".")
FileDelete($dRives[$iA] & "\DriveSpace.txt")
FileDelete($dRives[$iA] & "\DriveSpace.txt")
FileWriteLine($dRives[$iA] & "\DriveSpace.txt", $dRivespace2D[1] & " Gb" & @CRLF)
FileWriteLine($dRives[$iA] & "\DriveSpace.txt", $dRivespaceD[1] & " Gb" & @CRLF)
EndFunc ;==>_FileSpaceData
Func _FileListCreate()
$dRives2 = _RecursiveFileListToArray($dRives[$iA] & "\")
_ArraySort($dRives2)
FileDelete($dRives[$iA] & "\filelist.txt")
_FileWriteFromArray($dRives[$iA] & "\filelist.txt", $dRives2)
EndFunc ;==>_FileListCreate
; Author(s): Oscar (http://www.autoit.de)
; Anregungen von: bernd670 (http://www.autoit.de)
; und: AspirinJunkie (http://www.autoit.de)
;===============================================================================
Func _RecursiveFileListToArray($sPath, $sPattern = '', $iFlag = 0, $iFormat = 1, $fRecursion = True, $sDelim = @CRLF, $fOpenDLL = True)
Local $hSearch, $sFile, $sReturn = '', $aD
Local Static $hDll
If StringRight($sPath, 1) <> '\' Then $sPath &= '\'
$hSearch = FileFindFirstFile($sPath & '*')
If @error Or $hSearch = -1 Then Return SetError(1, 0, $sReturn)
If $fOpenDLL Then $hDll = DllOpen('kernel32.dll')
While True
$sFile = FileFindNextFile($hSearch)
If @error Then ExitLoop
If @extended Then
$aD = DllCall($hDll, 'dword', 'GetFileAttributesW', 'wstr', $sPath & $sFile)
If @error Or BitAND($aD[0], 0x400) Then ContinueLoop
If StringRegExp($sPath & $sFile, $sPattern) And ($iFlag = 0 Or $iFlag = 2) Then $sReturn &= $sPath & $sFile & '\' & $sDelim
If $fRecursion Then $sReturn &= _RecursiveFileListToArray($sPath & $sFile & '\', $sPattern, $iFlag, 0, True, $sDelim, False)
ContinueLoop
EndIf
If StringRegExp($sFile, $sPattern) And ($iFlag = 0 Or $iFlag = 1) Then $sReturn &= $sPath & $sFile & $sDelim
WEnd
FileClose($hSearch)
If $fOpenDLL Then DllClose($hDll)
If $iFormat And $sReturn = '' Then Return StringSplit($sReturn, '', $iFormat)
If $iFormat Then Return StringSplit(StringTrimRight($sReturn, StringLen($sDelim)), $sDelim, $iFormat)
Return $sReturn
EndFunc ;==>_RecursiveFileListToArray