Sub directory names

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
transolut
Newbie
Posts: 14
Joined: Wed May 19, 2004 2:00 pm
Location: Des Moines, IA USA

Sub directory names

Post by transolut » Tue Oct 21, 2014 1:21 pm

I'm trying to look in a current user's USER directory for a list of subdirectories that get created by an application and then copy a file into each subdirectory. I know the parent directory they are created in and what the subdirectory name does NOT look like.

The actual subdirectory names are a 16 digit hexadecimal name. I want to look for these names and then copy a file into each of the subdirectories. There can be one to about 6 subdirectories that the application creates each with a unique hexadecimal name.

I don't see a way to return a subdirectory list in MS.
Mike Miller
Transolut

hagchr
Automation Wizard
Posts: 328
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Re: Sub directory names

Post by hagchr » Tue Oct 21, 2014 3:29 pm

If you set GFL_TYPE=1 then GetFileList will return a list of directories. Then you can check which directories that match the hex name criteria and proceed (copy etc, here just a message box).

Code: Select all

Let>GFL_TYPE=1
GetFileList>C:\Users\.......\*.*,files,;
Separate>files,;,file_names

Let>ct=0
While>ct<file_names_Count
    Add>ct,1
    Let>tmp=file_names_%ct%
    RegEx>[0-9a-fA-F]{16},%tmp%,0,M,NM,0
    If>NM>0
        MessageModal>tmp
    Endif
EndWhile

User avatar
transolut
Newbie
Posts: 14
Joined: Wed May 19, 2004 2:00 pm
Location: Des Moines, IA USA

Re: Sub directory names

Post by transolut » Tue Oct 21, 2014 4:35 pm

Thank you that helps!
Mike Miller
Transolut

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts