; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3..1.1.64 ; Language: English ; Platform: WinXP ; Author: rtk217 ; ; Script Function: ; file lister ; ; ---------------------------------------------------------------------------- ; ---------------------------------------------------------------------------- ; Set up our defaults ; ---------------------------------------------------------------------------- ;AutoItSetOption("MustDeclareVars", 1) ;AutoItSetOption("MouseCoordMode", 0) ;AutoItSetOption("PixelCoordMode", 0) ;AutoItSetOption("RunErrorsFatal", 0) ;AutoItSetOption("TrayIconDebug", 0) ;AutoItSetOption("WinTitleMatchMode", 4) #NoTrayIcon #include #include #include #Include Global $path global $path2 Func filewriter($size, $attrib, $full, $version, $time, $name, $where) Dim $filelist Dim $sizearry[20] $filelist = _FileListToArray ($path) $path2 = $path $path = $path & "\files list.txt" if $where = 1 Then $path = @AutoItExe $path = StringReplace($path, "\filelister.exe", "") $path = $path & "\files list.txt" endif FileWrite($path, "") $handle = FileOpen($path, 2) If $size = 1 Then FileWrite($path, "|File size") If $attrib = 1 Then FileWrite($path, "|File Attributes") If $full = 1 Then FileWrite($path, "|File Full Path") If $version = 1 Then FileWrite($path, "|File Version") If $time = 1 Then FileWrite($path, "|File Time Modified") If $name = 1 Then FileWrite($path, "|File short name") FileWriteLine($path, "") FileWriteLine($path, "---------------------------------------------------------------------------------------------------------------------------------------------") FileWriteLine($path, "") For $i = 1 To $filelist[0] $file = $path2 & "\" & $filelist[$i] if $filelist[$i] = "files list.txt" then ContinueLoop FileWriteLine($path, "") $gotsize = FileGetSize($file) #comments-start $sleng = StringLen($gotsize) $sleng = int ($sleng) $smod = Mod($sleng, 3) $sdiv = ($sleng / 3) $sdiv = Int($sdiv) For $j = 1 To $sdiv $sizearry[$j] = $gotsize $sizearry[$j] = mod($sizearry[$j], 1000) $gotsize = int(($gotsize / 1000)) msgbox (0, "", $sizearry[$j]) Next $gotsize = "" If $smod = 0 Then $sdiv = ($sdiv - 1) for $il = $sdiv to 1 if $sizearry [$il] = "" then ContinueLoop $gotsize = $gotsize & "," & $sizearry[$il] next for $k = 1 to ($sdiv+1) $sizearry [$k] = "" next #comments-end $gotsize = $gotsize & " Bytes" If $size = 1 Then FileWrite($path, $gotsize & " ||| ") $gotattrib = FileGetAttrib($file) If $gotattrib <> "" Then If $attrib = 1 Then FileWrite($path, $gotattrib & " ||| ") Else If $attrib = 1 Then FileWrite($path, "No Attrib" & " ||| ") EndIf If $full = 1 Then FileWrite($path, $file & " ||| ") If FileGetVersion($file) <> "0.0.0.0" Then If $version = 1 Then FileWrite($path, FileGetVersion($file) & " ||| ") EndIf $t = FileGetTime($file, 0, 1) If $t <> 1 Then $tdate = StringLeft($t, 8) $tday = StringRight($tdate, 2) $tmonth = StringRight($tdate, 4) $tmonth = StringLeft($tmonth, 2) $tyear = StringLeft($tdate, 4) $tdate = $tday & "/" & $tmonth & "/" & $tyear $thour = StringRight($t, 6) $thour = StringLeft($thour, 2) $tminute = StringRight($t, 4) $tminute = StringLeft($tminute, 2) $tseconds = StringRight($t, 2) $tttime = $thour & ":" & $tminute & ":" & $tseconds $t = $tdate & "@" & $tttime If $time = 1 Then FileWrite($path, $t & " ||| ") EndIf If $name = 1 Then FileWrite($path, $filelist[$i]) Next FileClose($handle) MsgBox(0, "file created succesfuly", "the file was created succesfuly in :" & $path) EndFunc ;==>filewriter Func main() #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.5 Prototype #include If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GUICreate("File lister", 508, 253, (@DesktopWidth - 508) / 2, (@DesktopHeight - 253) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Label_1 = GUICtrlCreateLabel("Welcome to File lister.", 60, 30, 390, 20) $Label_3 = GUICtrlCreateLabel("This program will simply create a text file within is held all the names of the files and their sizes in the Directory you chose", 50, 60, 400, 30) $check1 = GUICtrlCreateCheckbox("Size", 60, 100) $check2 = GUICtrlCreateCheckbox("Attributes", 110, 100) $check3 = GUICtrlCreateCheckbox("Full Path", 190, 100) $check4 = GUICtrlCreateCheckbox("Version", 270, 100) $check5 = GUICtrlCreateCheckbox("Time", 340, 100) $check6 = GUICtrlCreateCheckbox("File Name", 400, 100) $check7 = GUICtrlCreateCheckbox("List Where Program Is", 200, 120) $Input_4 = GUICtrlCreateInput("", 0, 170, 500, 30) $Label_5 = GUICtrlCreateLabel("Enter the directory path (if clear the program will list the files withing its own directory):", 30, 140, 400, 20) Opt ("GUICoordMode", 2) $buttonok = GUICtrlCreateButton("OK", -80, 60, 50) $buttoncancel = GUICtrlCreateButton("Cancel", 0, -1) $Label_4 = GUICtrlCreateLabel("Made by Ro.E - B aka rtk217", -300, -10, 390, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $buttonok $path = GUICtrlRead($Input_4) $check1 = GUICtrlRead($check1) $check2 = GUICtrlRead($check2) $check3 = GUICtrlRead($check3) $check4 = GUICtrlRead($check4) $check5 = GUICtrlRead($check5) $check6 = GUICtrlRead($check6) $check7 = GUICtrlRead($check7) If $path = "" Then $path = @AutoItExe $path = StringReplace($path, "\filelister.exe", "") EndIf if stringright ($path, 1) = "\" or stringright ($path, 1) = "/" then $path = stringleft ($path, (stringlen($path) - 1)) filewriter($check1, $check2, $check3, $check4, $check5, $check6, $check7) Case $msg = $buttoncancel ExitLoop EndSelect WEnd #endregion --- GuiBuilder generated code End --- EndFunc ;==>main Call("main")