Sign in to follow this  
Followers 0
dNino

not searching all directory's?

7 posts in this topic

how is it possible that the following isn't working correctly?

Func idx($dir)
    $contents=FileFindFirstFile($dir&'\*')
    While 1
        $content=FileFindNextFile($contents)
        If @error Then ExitLoop
        $names&=$content&'|'
        $dirs&=$dir&'|'
        If FileGetAttrib($dir&'\'&$content)='D' Then
            If Not StringInStr($dir,'\') Then
                MsgBox(0,'dir',$dir&'\'&$content)
            EndIf
            idx($dir&'\'&$content)
        EndIf
    WEnd
    FileClose($contents)
EndFunc
thanks to that msgbox() I know that it only searches:

- c:\windows

on the c drive and

- d:\Documents and settings

- d:\Windows

on the d drive.

while I have other directory's on both drives...

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I don't see an edit-button, maybe because its the first post in a topic...

I've tested it on a diverend notebook, wich has windows XP, here it works...

I have windows Vista.

Someone know a solution?

Edited by dNino

Share this post


Link to post
Share on other sites

You didn't say exactly what you are passing into the function call for $dir.

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

all fixed drives

so c: and d: in my case.

Edited by dNino

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

"If FileGetAttrib($dir&'\'&$content)='D' Then" is a problem. It should be more like...

If StringInStr(FileGetAttrib($dir&'\'&$content), 'D') Then

edit -

Just to clarify, the reason to do it like that is because, say a directory is also read only and maybe set to archive, then FileGetAttrib will return something like 'RAD.'

Edited by xcal

Share this post


Link to post
Share on other sites

"If FileGetAttrib($dir&'\'&$content)='D' Then" is a problem. It should be more like...

If StringInStr(FileGetAttrib($dir&'\'&$content), 'D') Then

edit -

Just to clarify, the reason to do it like that is because, say a directory is also read only and maybe set to archive, then FileGetAttrib will return something like 'RAD.'

Thank you, it's working :whistle:

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  
Followers 0