Kylin Posted October 7, 2006 Share Posted October 7, 2006 (edited) I Used "dir',But I Dont Like This,Because I need a tempfile. RunWait(@Comspec & ' /c ' & 'dir D: /b > C:\temp.txt','',@SW_HIDE) $File = FileOpen('C:\temp.txt',0) $i = 1 While 1 $Var = FileReadLine($File,$i) If @error Then ExitLoop EndIf $isFolder = DirGetSize('D:\' & $Var) If $isFolder = -1 Then MsgBox(1,'','File:' & $Var) Else MsgBox(1,'','Folder:' & $Var) EndIf $i = $i + 1 WEnd FileClose($file) Edited October 7, 2006 by Kylin Link to comment Share on other sites More sharing options...
Valik Posted October 7, 2006 Share Posted October 7, 2006 Moved to correct forum. Link to comment Share on other sites More sharing options...
Kylin Posted October 7, 2006 Author Share Posted October 7, 2006 (edited) Thanks Mod! Edited October 7, 2006 by Kylin Link to comment Share on other sites More sharing options...
Paulchen Posted October 7, 2006 Share Posted October 7, 2006 Well, this works on my compy global $PathSave global $fs $objErr = ObjEvent("AutoIt.Error","ErrorHandler"); COM error handler $fs = ObjCreate("Scripting.FileSystemObject") _ReadDir("C:\temp") exit ;============================================================== Func _ReadDir($spfad) ;============================================================== Local $dir consolewrite($spfad & @CRLF) $PathSave = $spfad ;Need for error msg $dir = $fs.GetFolder($spfad) For $subdir in $dir.SubFolders() if @error Then ConsoleWrite ("Error " & $subdir &" Folder Error : " & @error & " " & @CRLF) else _ReadDir($subdir.Path) if @error Then ConsoleWrite( "Error " & $PathSave &" Folder Error1 : " & @error & @CRLF) EndIf Next EndFunc ;============================================================== Func ErrorHandler() ;============================================================== Local $HexNumber = Hex($objErr.number, 8) MsgBox(0,"COM ERROR Occured!", $PathSave & @CRLF & _ @TAB & "Error Number: " & $HexNumber & @CRLF & _ @TAB & "Source: " & $objErr.source & @CRLF & _ @TAB & "Error Number: " & $objErr.number & @CRLF & _ @TAB & "Script Line Number: " & $objErr.scriptline & @CRLF & _ @TAB & "Description: " & $objErr.description & @CRLF & _ @TAB & "Helpfile: " & $objErr.helpfile & @CRLF & _ @TAB & "Helpcontext: " & $objErr.helpcontext & @CRLF & _ @TAB & "Lastdllerror: " & $objErr.lastdllerror & @CRLF & _ @TAB & "WinDescription: " & $objErr.windescription & @CRLF ) ConsoleWrite("Error " & $PathSave & " Error Number " & $objErr.number & " at line " & $objErr.scriptline & @CRLF ) Return SetError($objErr.number, 0, 0) EndFunc Link to comment Share on other sites More sharing options...
neuro Posted October 7, 2006 Share Posted October 7, 2006 Well, this works on my compy [...] Yeah, that works beautifully - thank you for sharing. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now