icemanV Posted April 18, 2007 Share Posted April 18, 2007 Hi Anyone have any idea how to check whether the filename extension is .lnk or .exe or .bat etc. I was looking through the functions and marcos but failed to find a suitable functions or marcos thanks IceMan Link to comment Share on other sites More sharing options...
Paulie Posted April 18, 2007 Share Posted April 18, 2007 (edited) Hi Anyone have any idea how to check whether the filename extension is .lnk or .exe or .bat etc. I was looking through the functions and marcos but failed to find a suitable functions or marcos thanks IceManI made a UDF for you: MsgBox(0,"Test.txt", _GetExt("Test.txt")) Func _GetExt($Filename) $Int = StringSplit($Filename, ".") If IsArray($Int) Then Return "."&$Int[UBound($Int)-1] Else Return 0 EndIf EndFunc Edited April 18, 2007 by Paulie Link to comment Share on other sites More sharing options...
icemanV Posted April 18, 2007 Author Share Posted April 18, 2007 Hi Paulie Thanks... your function is perfect!!! IcemanV 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