Jump to content
Sign in to follow this  
Marspidey

File Count

Recommended Posts

Marspidey

I have this same function on another computer where the script works but when I try adding the script to another computer it won't recognize that the files are there. Any help is appreciated.

$filecount = ControlListView ( "C:\filecheck", "", "SysListView321", "GetItemCount") ;Check for new files
        If $filecount <= 0 Then ;If no new files exit program
            $filecheck = False  ;Set new files status to false

Share this post


Link to post
Share on other sites
Marspidey

"C:\filecheck" is the, full, correct title of the window you are reading? Including the case?

Yes, the title is correct.

Share this post


Link to post
Share on other sites
lod3n

Using the AutoIt Window Info Tool, can you verify the window title, as well as the SysListView id? For instance, make sure it isn't something weird like SysListView322.


[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Share this post


Link to post
Share on other sites
Marspidey

Using the AutoIt Window Info Tool, can you verify the window title, as well as the SysListView id? For instance, make sure it isn't something weird like SysListView322.

They're correct.

Share this post


Link to post
Share on other sites
GMK

Perhaps this would work better?

#include <File.au3>
$aFiles = _FileListToArray("C:\filecheck")
$filecount = $aFiles[0] ;Check for new files
If $filecount = 0 Then ;If no new files exit program
   $filecheck = False  ;Set new files status to false
...

Share this post


Link to post
Share on other sites
Marspidey

Perhaps this would work better?

#include <File.au3>
$aFiles = _FileListToArray("C:\filecheck")
$filecount = $aFiles[0] ;Check for new files
If $filecount = 0 Then ;If no new files exit program
   $filecheck = False  ;Set new files status to false
...
Just tried that and it didn't work. Any other suggestions?

Share this post


Link to post
Share on other sites
GMK

Just tried that and it didn't work. Any other suggestions?

#include <File.au3>
$aFiles = _FileListToArray("C:\filecheck")
If Not IsArray($aFiles) Then ;If no new files exit program
   $filecheck = False  ;Set new files status to false
...

Share this post


Link to post
Share on other sites
GMK

Have a look at DirGetSize() in the helpfile .. :)

Oh...I thought that only got the file size, but now I see it can get more. That's better and shorter than my way. Thanks for the tip.

Share this post


Link to post
Share on other sites
Marspidey

I got it working. Thanks to you all.

Share this post


Link to post
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
Sign in to follow this  

×