Jump to content

Recommended Posts

Posted

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!

Posted

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!

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

Monkeh.

Posted

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!

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
×
×
  • Create New...