Jump to content

FileFindFirstFile in shared files


arnonym
 Share

Recommended Posts

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:

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
Share on other sites

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]
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...