2o2 Posted June 27, 2007 Share Posted June 27, 2007 how do i make a script that will check the amount of space in a directory but only check the space occupied by files that end in .doc (microsoft word document files). so far this is what i have but it returns -1??? $docdir = DirGetSize(@MyDocumentsDir & "\*.doc" ) msgbox(0, "d", $docdir) Rick rack ree, kick 'em in the knee.Rick rack rass, kick 'em in the other knee! Link to comment Share on other sites More sharing options...
2o2 Posted June 27, 2007 Author Share Posted June 27, 2007 how do i make a script that will check the amount of space in a directory but only check the space occupied by files that end in .doc (microsoft word document files). so far this is what i have but it returns -1???$docdir = DirGetSize(@MyDocumentsDir & "\*.doc" )msgbox(0, "d", $docdir)cmon peoples heres the script Rick rack ree, kick 'em in the knee.Rick rack rass, kick 'em in the other knee! Link to comment Share on other sites More sharing options...
AutoItKing Posted June 27, 2007 Share Posted June 27, 2007 Search for all the files with the .doc extension in that dir, then get the sizes of them all and add them up. http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script] Link to comment Share on other sites More sharing options...
m0nk3yI3unz Posted June 27, 2007 Share Posted June 27, 2007 (edited) KK This should work. func _DirGetSizeExtension($Dir,$extension="*");Leave off "." before extension. dim $Files = dirgetsize($Dir&"\") $Count = 0 $Search = FileFindFirstFile($Dir&"\*."&$extension) for $i = 1 to $Files[1] $Next = FileFindNextFile($Search) if @error then ExitLoop Elseif stringright($Next,3) = $extension then $Count += filegetsize($Next) EndIf Next return $count endfunc EDIT: Umm.. Dunno why theres no hiliting (Still new to the forum...) Edited June 27, 2007 by m0nk3yI3unz Monkeh. Link to comment Share on other sites More sharing options...
2o2 Posted June 28, 2007 Author Share Posted June 28, 2007 make it clearer, here is my script so far #NoTrayIcon ;script for marta lesley pearl progresson("Marta Backup", "Backing Up....") progressset(10) sleep(300) filecopy(@MyDocumentsDir & "\*.doc" , "C:\" ,1) progressset(70, "", "Checking For Errors...") sleep(100) progressoff() msgbox(0, "Errors", "0 Errors Found!", 1) Rick rack ree, kick 'em in the knee.Rick rack rass, kick 'em in the other knee! 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