How to check each file i directory for motify date?

Hello everybody, i am new to tho this and hope you guys can help me.
I would like to check every file in a specifiek directory (each one).
image
If the file is adjusted within 30 days. i would like to move it to a other directory file. if not i just want to leave it there.

can anybody help me out with this problem.

Hi @DukkyS,

Please try this assign. This assign will give you the files which is earlier than 30 day before.

arrFiles = Directory.GetFiles(“YourFolderPath”).Where(Function(x) New FileInfo(x).LastWriteTime.Date < Today.Date.AddDays(-30))

You can put this list in for each and move them.

Regards.
Ömer

@DukkyS,

Did it work?

Regards.
Ömer

thank you for your, fast reply.
I think i need to watch more tutorials before i continu.
I tried it but it gave a error.
I have no clue what i did wrong :slight_smile:

Hi @DukkyS

You can try with For each file in Folder activity

image

Check out the Tutorial

Regards
Gokul

@DukkyS,

If you want, you can share your screenshot.

I will try to help.

Regards.
Ömer

@omer.ozturk
What kind if varible does it need to be?

in the folder are like 500 files. i don;t think it is smart to go trough all of them with a each file in folder. or does that not matter

@DukkyS,

arrFiles need to be string array. Array[String]

This statement give you all folder paths earlier than 30 days. Click the Array of T, then click String.

image

Regards
Ömer