Jump to content

Confirming data


 Share

Recommended Posts

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

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

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

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 by m0nk3yI3unz

Monkeh.

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...