Jump to content
Sign in to follow this  
icemanV

Any functions or methods to check for shortcut or .exe or .bat

Recommended Posts

icemanV

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

Share this post


Link to post
Share on other sites
Paulie

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

I 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 by Paulie

Share this post


Link to post
Share on other sites
icemanV

Hi Paulie

Thanks... your function is perfect!!!

IcemanV

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.