Jump to content

Recommended Posts

Posted

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?

Posted

Hi!!

Maybe you can check the AutoIT help for FileFindFirstFile example, and use the FileChangeDir to change the working dir.

Hope this help.

Posted

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

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Posted

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

Posted

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.

Posted

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.

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
  • Recently Browsing   0 members

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