How to see what is in the folders?

Hi Team

I have several folders with p.12 keys

Screenshot_1

there are 2 keys in the folder

Screenshot_2

I need to know the expiration date of all keys in all folders

How can i do this?

@Aibek_Abubakirov How are you going to find the Expiration Date manually?

@Aibek_Abubakirov

Let us know how you are seeing the expiry dates of the files?

Thanks

Hi @Aibek_Abubakirov

Use assign activity and create a array of string variable = Directory.GetFiles(“Folder Path”) Example like this [ Directory.GetFiles(“C:\Users\gulshiya\Desktop\sampleTest”)]

Then use For each activity and inside the body keep message box or writeline .
Thats it you will get the file name as well as path
If you dont want that path mean just split it

cool,
Regards,
Gulshiyaa

@supermanPunch @Srini84
Can be found through web services

@Aibek_Abubakirov
Is the expiry date inside the file or in the file name?
Can you please send the full name of the file along with extension

The expiration date can be found through the web service or by the date the file was created

File .p12

I need to find out the names of all files and start working with them one by one

Fine
Did we try with GET FILEINFO activity
https://docs.uipath.com/studiox/docs/get-file-info-x

That is first get all the file paths from all sub folders and then pass that array variable to for each activity
Inside that loop we can use Get FileInfo activity and from that we can know the creation date we want

Cheers @Aibek_Abubakirov

@Aibek_Abubakirov

Follow the below steps:

  1. Get all files with specific file type from the specified folder. Result will be an array of file paths
    arFiles = Directory.GetFiles(strFileName, strFileExtension, SearchOption.AllDirectories)
    strFileExtension => the type of file (e.g., for excel files “*.xlsx”)
  2. Loop through each files (Specify the Type Argument in For each activity property as string)
    for each(var file in arFiles)
    {
    //Get created date time for the file
    DateTime dateCreated = Directory.GetCreationTime(file);
    //Calculate expiry date from date created
    }

Let me know if this is helpful for you.

1 Like