System.ArgumentException: Illegal characters in path

Hello Expertise
Please help me in this error
System.ArgumentException: Illegal characters in path. Where my NewPath variable contain some path and error arise here.
new

Hey @James90

Try to writeline your path first for debug purpose then see if some character is coming in file path which is not supported by windows or else.

Regards…!!
Aksh

1 Like

Hi @aksh1yadav
My NewPath gives “C:\ESD” and I want this path, but I am getting illegal path error?

@James90,

Can you remove back slash in your directory.getfiles and give a try and what NewPath contains, remove Newpath hardcode and see if you are getting the error, if its working then there are extra spaces or special characters in NewPath variable

1 Like

@James90,

Could you please show me what you assigned to NewPath.

For your reference pls find the attached workflow.

Test.xaml (7.9 KB)

1 Like

Hey @James90

Escape "\" in your path and try like this :- C:\\ESD

Regards…!!
Aksh

1 Like

I am having illegal characters in the path in this. Please, can you solve it?rrrrrr
NewPath contains the path to save the file. “C:\Users”

@Kuenzang,

    Change '/' to '\'

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.