Looping@12

How to choose a folder using select folder, then loop throughout to find the files, then to sort out files ,and then to create new folders for files according to their extension

Select folder requires a user to actually select the folder, thus this is NOT for a robot that works in the background, is that ok?

How to choose a folder using select folder

Use the ‘select folder’ activity → save to string variable i’ll call SelectedFolder

then loop throughout to find the files

Use a ‘for each’ activity. TypeArgument should be string. The object to iterate over is: Directory.GetFiles(SelectedFolder). The final would be: For each file in Directory.GetFiles(SelectedFolder)

then to sort out files ,and then to create new folders for files according to their extension

Since you’re in a for each loop, no need to sort the files. Use an ‘create directory’ activity. The input should be: Path.GetExtension(file).Replace(".",string.empty) This will create a folder for each type of extension. Note that the ‘create directory’ actiity will create a folder if it doesn’t exist & if it does already exist it will simply move onto the next file in the for each