The given path’s format is not supported

The given path’s format is not supported.

Path.Combine(second_subfolder_path,path.GetFileName(item))+" \ “+item.ToString+”_LoginSheet.pdf"
Please any one correct this.

Hi @vijaykumar_lod
what is the item you are trying to print

Thanks
Ashwin S

it could be an issue with copy-paste of quotes. you can retype them to see if the error goes.
If not please share a screenshot of the compilation error by hovering over the blue icon

there is a mainfolder_1 having multiple subfolders and in those subfolders having multiple files where i am copying the file to mainfolder2 with same name of subfolders where i am going to rename file name with “Subfoldername_existingfileName” from every subfolders from mainfolder1 to mainfolder2.

Please find attached project.CPA_DATA_COPY_final.xaml (11.9 KB)

i Dont find any error. I am getting error during run time.

Hi @vijaykumar_lod

Can you try to debug the code by adding few breakpoints and see what values the variables are getting. Also try to print the full combined string to see how the final one looks like

1 Like

Path.Combine(second_subfolder_path,path.GetFileName(item))+“/”+item.ToString+“_LoginSheet.pdf”

I believe you should replace “/” with backslash in the above.

If that doesn’t help, try storing "F:" as a variable and use it as part of your path. I found “C:\users\userID” causing the same issue and replaced it with Environ(“userprofile”), which resolved the problem.