Sign in to follow this  
Followers 0
arnonym

FileFindFirstFile in shared files

5 posts in this topic

Hey,

I have got a problem with searching files in shared files. Usually I use recursive funcions with FileFindFirstFile and FileFindNextFile. But in \\192.168.2.61 for example FileFindFirstFile returns an error. Do you have an idea to solve this problem?

Thank you

arnonym :mellow:

Share this post


Link to post
Share on other sites



Hi,

!! UNC convention!!. You never find something on \\192.168.2.61

\\<name or ip>\<sharename or administrative share like c$\<folder>

e.g -> $search = FileFindFirstFile ("\\192.168.2.61\c$\temp\*.tmp")

Initialize search on ipaddress 192.168.2.61 in administrative share c$ in folder temp any tmp file.

;-))

Stefan

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thx for your answer 99ojo,

but I don't understand the problem.

On the "server" I shared the folder "C:\temp".

But if I try your suggestion it doesn't work.

FileFindFirstFile("\\192.168.2.61\c$\temp\*.tmp")

Can you help me one more time?

Thanks for the fast reply! :mellow:

arnonym

Edited by arnonym

Share this post


Link to post
Share on other sites

Hi,

my suggestion works only on Windows Server. For accessing administrative share, you must have administrative rights on server.

For your example:

1) Share c:\temp as Temp

2) Per default on windows server Everyone has Read Access on share, you might have a problem with your ntfs settings.

3) So your code should look like this: FileFindFirstFile("\\192.168.2.61\temp\*.tmp")

If this doesn't work, check your share access: Start Button -> Run -> \\192.168.2.61\temp and then press enter.

If no explorer window popups or an error occured, you have problems accessing share.

This is then a configuration problem of your share and not an autoit problem.

;-))

Stefan

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

this is kind of cheesey but it works everytime :mellow:

Func CheeseyFind()
    $Server = '\\192.168.2.61\c$\Temp\'
    $Local = @TempDir
    Dim $File = $Local & '\find.txt'
    Dim $Where

    $Dir = $Server & '*.tmp'

    RunWait(@ComSpec & ' /c ' & 'dir "' & $Dir & '" /a :h /b /s' & ' > "' & $Local & '\find.txt"', '', @SW_HIDE)

    _FileReadToArray($File, $Where)

    For $x = 1 To $Where[0]
        MyFunc($Where[$x]) ; Or do what you want to do with results , in this example its called line at a time.
    Next

    FileDelete($File)

EndFunc   ;==>CheeseyFind
Edited by lordicast

[Cheeky]Comment[/Cheeky]

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