Jump to content
Sign in to follow this  

Get only the filename from a path

Recommended Posts



First of all, if there is a post about this please gimme the link and dont say "Use search you n00b!". I used the search, it returned like 36 pages, went through first 2 and did't find anything... thx :P


Ok heres my question:

Is there a way to get only the filename in a path ;)?

So, lets say my path is: "C:\somefolder\somefile.txt"

And i want autoit to return: "somefile.txt"

I looked at the several string**** functions, but didn't find anything that worked :"> .

I thought StringInStr would work so i get the position where the filename starts and then use one of the trim commands. But for the StringInStr i need some kind of a placeholder, one for "*" (undefined amount of characters) and one for the end of the string.

Any solutions for this?? Would greatly appreciate it!

tdlrali (Felix)

Share this post

Link to post
Share on other sites

Thanx :P

Was too easy! ^^

+10 points honor for JdeB ;)


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