Comparing two file directories and transferring files that are not in the other path


I have 2 file paths. One of which is
\gicfnp01\ERP Testing\Team_share\27_RPA\InternationalPayroll\Countries\Australia\2019\Nov\Output

the other is
\gicfnp01\ERP Testing\Team_share\27_RPA\InternationalPayroll\Countries\Australia\2019\Nov\Output\New Compressed (zipped) Folder

i want to compare the files in both locations and only transfer the ones that are not in the other path. ie not duplicates.

i have the below sequence which compares the full file paths which will return a negative result every time as the paths are different. I want to just compare the files in each of the folders at the end of the path.

Kindly try with this expression
list_filepath = Directory.GetFiles(“gicfnp01\ERP Testing\Team_share\27_RPA\InternationalPayroll\Countries\Australia\2019\Nov\Output\New Compressed (zipped) Folder“).Except(Directory.GetFiles(“gicfnp01\ERP Testing\Team_share\27_RPA\InternationalPayroll\Countries\Australia\2019\Nov\Output”)).ToList()

Cheers @Automater999

This is what i originally tried

I tried this and it just returned what was in the first file path


the path

\gicfnp01\ERP Testing\Team_share\27_RPA\InternationalPayroll\Countries\Australia\2019\Nov\Output\TEST EXCEL.xlsx

is after the except function