Jump to content
Sign in to follow this  

Path split question

Recommended Posts


Hey everyone. Just a quick one

I'm trying to split a path. This works fine in the respect that it gets the location of the zip so I can extract it to TEMP2 but the only problem I have is that i'm trying to figure out how I can name the extrated folder...The code below will work fine with my .ini file If I name the folder to the zip that extracts. However I'm trying to work out how I can name the folder the name at the top..

Anyone have any ideas..

_PathSplit($files[$i],$null,$null,$fname,$null);gets the name of the folder at top level

The idea so far is this, but it doesn't name my extracted folder the name the folder comes from..


The folder is like this




My code above quite happily gets the zip file and will extract it to a folder that the name is taken from the zip file...

So the name of the folder thats extracted would be ITEM....But I want the name to be FOLDER1

Edited by jben

Share this post

Link to post
Share on other sites

IMO, creating a unique folder name would help prevent issues in case the folder already exists. If so, then you may use the _ TempFile() standard UDF to generate a folder path.

#include <File.au3>
$folder_temp = _TempFile(@TempDir, "~", "")
MsgBox(0x40000, Default, $folder_temp)


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.