GameIDevelp Posted January 24, 2009 Share Posted January 24, 2009 The script work but on 2 round not see the file ,, how I can use again "$v[1] , $v[2] - $v[5] ..? I can use on code fore return the $v[1] to -1 if $v[1] find the file .? How I cand use the array another , another again ..? expandcollapse popup#Include <File.au3> #Include <Array.au3> #NoTrayIcon $v=_FileListToArray("D:\Documents1", '*', 2) If @Error=1 Then MsgBox (0,"","Error ") Exit EndIf $bLoop = 1 While $bLoop = 1 $bos = "D:\Documents1\" & $v[1] $search1 = FileFindFirstFile($bos &"\index_06[1]oooooooooo.gif") if $search1=1 Then MsgBox(0,"ok-1","Find") Else ;MsgBox(0,"else-1",$bos) ;---next-folder $bos2 = "D:\Documents1\" & $v[2] $search2 = FileFindFirstFile($bos2 &"\index_06[1]oooooooooo.gif") if $search2=1 Then MsgBox(0,"ok-2","Find") Else ;MsgBox(0,"ddddd",$search2) ;---next-folder $bos3 = "D:\Documents1\" & $v[3] $search3 = FileFindFirstFile($bos3 &"\index_06[1]oooooooooo.gif") if $search3=1 Then MsgBox(0,"ok-3","Find") Else ;MsgBox(0,"ddddd",$search3) ;--next-folder---3 $bos4 = "D:\Documents1\" & $v[4] $search4 = FileFindFirstFile($bos4 &"\index_06[1]oooooooooo.gif") if $search4=1 Then MsgBox(0,"ok-4","Find") Else ;MsgBox(0,"ddddd",$search4) ;--next-folder-4 $bos5 = "D:\Documents1\" & $v[5] $search5 = FileFindFirstFile($bos5 &"\index_06[1]oooooooooo.gif") EndIf EndIf EndIf EndIf MsgBox(0,"kk","tura") Sleep(3000) $bLoop = 1 WEnd Link to comment Share on other sites More sharing options...
Authenticity Posted January 24, 2009 Share Posted January 24, 2009 As much as I can understand this script purpose.... First, your code include unnecessary comparisons and statements. For example the $bLoop is completely unnecessary, use While 1...WEnd instead and if you want to finish the loop use the ExitLoop statement. Second, "If $search2=1 Then" is equivalent to "If $search2 Then" and faster. If you want to find specific file using the FileFindFirstFile...FileFindNextFile....FileClose, it required recursive function because you probably don't know all the folder and where it can be found so use recursive function with FileGetAttrib to check if a file is folder or not... Good-luck. Link to comment Share on other sites More sharing options...
GameIDevelp Posted January 24, 2009 Author Share Posted January 24, 2009 thanks for replay , This code I use to search 1 file intro the 5 folders , shee work but at round 2 or more rounds "$v[1] return -1 ,,, why.? Link to comment Share on other sites More sharing options...
Authenticity Posted January 24, 2009 Share Posted January 24, 2009 (edited) Use FileExist instead if you know the paths. Edit: Don't forget that you need to check whether the file is folder or simple file. In case you didn't know there are two other files in each folder (root is exception) ---> '.' and '..' so these two are also included in the returned array I think Edited January 24, 2009 by Authenticity Link to comment Share on other sites More sharing options...
GameIDevelp Posted January 24, 2009 Author Share Posted January 24, 2009 I use ,, sleep(5000) ShellExecute("myprog.exe") exit and shee run the myprog then exit and run then exit ,,, again and again , , Link to comment Share on other sites More sharing options...
Authenticity Posted January 24, 2009 Share Posted January 24, 2009 More code please because it's exactly what you ask the script to do heh, what else should it? Link to comment Share on other sites More sharing options...
FireFox Posted January 24, 2009 Share Posted January 24, 2009 its like : Run(@ScriptFullPath) ExitoÝ÷ Ù«¢+Ù%¹½ÐÁɽÍÍá¥ÍÑÌ¡Õѽ¥ÑA%¤Ñ¡¸)IÕ¸¡MÉ¥ÁÑÕ±±AÑ ¤)¹%)ᥠCheers, FireFox. Link to comment Share on other sites More sharing options...
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