salim Posted July 17, 2012 Posted July 17, 2012 If FileExists("C:\autoexec.bat") Then MsgBox(0, "Information..", "OK")Else MsgBox(0, "Information..", "U Lost Data")EndIf;Ok..I want add any file in FileExists.. If FileExists("C:\autoexec.bat","Notepad.exe","cmd.exe") Then MsgBox(0, "Information..", "OK")Else MsgBox(0, "Information..", "U Lost Data")EndIf; Error...Thank's.. I hope i get the solution..
somdcomputerguy Posted July 17, 2012 Posted July 17, 2012 If FileExists("C:autoexec.bat") Or FileExists("Notepad.exe") Or FileExists("cmd.exe") Then - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
salim Posted July 17, 2012 Author Posted July 17, 2012 (edited) If FileExists("Back.bmp") and FileExists("button.bmp") and FileExists("Icon.bmp") ThenMsgBox(0, "Information..", "OK")ElseMsgBox(0, "Information..", "U Lost Data")EndIf; Ok... Than's to somdcomputerguyIt's posible to make filexists with array..??How to create it's..?Thank's just to know command in autoit.. Edited July 17, 2012 by salim
AZJIO Posted July 17, 2012 Posted July 17, 2012 (edited) #include <Array.au3> Global $Array[3] = ['C:autoexec.bat', 'Notepad.exe', 'cmd.exe'] _ArrayDisplay($Array, 'Array') $Yes = _FileExists($Array) MsgBox(0, '?', 'Yes=' & $Yes & @CRLF & 'No=' & @extended) Func _FileExists($Array) Local $Yes = 0, $No = UBound($Array) For $i = 0 To $No - 1 If FileExists($Array[$i]) Then $Yes += 1 Next Return SetError(0, $No - $Yes, $Yes) EndFunc Edited July 17, 2012 by AZJIO My other projects or all
salim Posted July 17, 2012 Author Posted July 17, 2012 Thank AZJIOIf i may ask again, what the meanTo $No - 1andThen $Yes += 1why -1 and +=1 , if i change to 2 or 3 no efek in script. U'r scirpt no error message..thank's..
PhoenixXL Posted July 17, 2012 Posted July 17, 2012 (edited) $Yes += 1means $Yes=$Yes+1To $No - 1this is because its an Array and the Ubound is the number of dimensions present starting from 1whereas when we use the array the size starts from 0=> $array[10] is $array[0], $array[1].....$array[9] {note 10 is not present, if it is called it will cause an error (i.e. $array[10]) } Edited July 17, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
salim Posted July 17, 2012 Author Posted July 17, 2012 Oooww.. I see.. Thank's PhoneixXL.. Thak's for all..
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