Jump to content

Get the name of a dir


Recommended Posts

The name of a particular directory/folder changes. The only part of the name that stays consistent is the last 9 characters. Can I pull the name of the dir after it is copied using dirCopy? Or do I have to work with _filelisttoarray?

Link to comment
Share on other sites

Roguex2,

If you can detect the name change then you can likely get the dir name.

There is not enough info/code here to provide an adequate response.

kylomas

Basically I am copying a folder that is the "only folder in a particular directory" over to a desktop using DirCopy("\\location\location*.*"). I would then need to open the folder that has been copied to the destkop. However since I don't know the name I can't access it.

I guess I could use _filelisttoarray and the name would be in array [1]. How do I pass that value to string?

Thanks

Link to comment
Share on other sites

You can use wildcards

FileChangeDir(@DesktopDir)

$search = FileFindFirstFile("*.") <=== search for all the directories

or u can use the last 9 characters

$search = FileFindFirstFile("*123456789.") <=== this will match every dir with the characters "123456789" at the end.

then use the

$file = FileFindNextFile($search) to get the name.

Link to comment
Share on other sites

You can use wildcards

FileChangeDir(@DesktopDir)

$search = FileFindFirstFile("*.") <=== search for all the directories

or u can use the last 9 characters

$search = FileFindFirstFile("*123456789.") <=== this will match every dir with the characters "123456789" at the end.

then use the

$file = FileFindNextFile($search) to get the name.

Thanks...will when I get to work this morning.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...