Problem with move file

I have a problem with the move activity

I get the message Illegal characters in path.

But there are no illegal characters in path. It happens when i put a “.pdf” string after the variable which contains the new file name.
What is the solution for this problem?



It also happens with te copy activity

here is the test file:
PDF Hotfolder Revit extract, Rename and move file TEST 2.xaml (30.1 KB)

Hey @nicostegeman,
Sorry that I can’t open the attached file…
Can you tell me what’s value of path and destination of the file…?

Best Regards,

Hello Santosh

The move activity does not work when i use the two variables to name de path and file: (Folder_werken_Tekeningen_pdf+Filename_pdf_file_compleet)

But the move activity works well when i use for example “Y:\testfolder\filename.pdf”

It shouldn’t be the case. We can use as many variables as we wish, it’s just a string concatenation…
Can you please check whether you’re missing any "" value between the variable? Or share the values of variables here.

What are illegal characters in path? is an underscore an illegal character?

testfile.pdf (57 Bytes)

it is a .txt file remove .pdf

can you run the program and show the output as a message box or write line activity instead? That is a helpful first step in debugging to ensure the variables contain the values you’re expecting

This is the right file remove .pdf
@Dave i run the output in a message box and the values are as axpected

write file.txt.pdf (58 Bytes)


Can you verify that your source and destination path are valid. You mentioned you are validating using a message box right? Are you able to navigate to the folder level correctly? There might be a \\ or something being added.

I found the problem:

when i type in value of this activity “the needed string” in stead of the regex expression the move activity works
and i think it is because of that the expression put a white space behind the needed string
what should i change in this expression?

I am searching in this text in a pdf
as you can see i want the text behind Ui_naam:

Use a .Trim() method to eliminate spaces.

1 Like

A lot of Thanks
PD2 , Dave and @SantoshPothina
the spaces at the end of a variable was causing the problem.

1 Like