arnonym Posted February 18, 2010 Posted February 18, 2010 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
99ojo Posted February 18, 2010 Posted February 18, 2010 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
arnonym Posted February 18, 2010 Author Posted February 18, 2010 (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! arnonym Edited February 18, 2010 by arnonym
99ojo Posted February 18, 2010 Posted February 18, 2010 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
lordicast Posted February 18, 2010 Posted February 18, 2010 (edited) this is kind of cheesey but it works everytime 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 February 18, 2010 by lordicast [Cheeky]Comment[/Cheeky]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now