Sign in to follow this  
Followers 0
rossnixon

Splitting full pathname into pathname, filename, extension

4 posts in this topic

Hi there,

I am pulling a full path into a script using $var = $CmdLine[1] (tested this, working OK).

I am right-clicking a certain filetype to run a compiled script on.

How do I split $var into three new variables - the directory path, filename, extension.

Thanks,

Ross

Share this post


Link to post
Share on other sites



StringinStr

StringRight

StringLeft...

Theres a bounch of string tools, you should be able to find some there will fit your need :)


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

Also, my favorite for splitting a path is _PathSplit. :)

More info and example in AutoIt help file under

User Defined Functions->File Management->_PathSplit

Cheers

Share this post


Link to post
Share on other sites

Also, my favorite for splitting a path is _PathSplit. :)

More info and example in AutoIt help file under

User Defined Functions->File Management->_PathSplit

Thanks. Hopefully that will help someone else when they search the forum.

I managed to get it done using the first answer.

It was easier than I thought, especially since I could search from the right hand side for the "\".

Ross

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  
Followers 0