Converted from Window Legacy to Windows

Hi, I just converted a project from Windows Legacy to Windows. For some reason, the files all end up with Nul at the end of their name when they didn’t previously in Legacy.

The automation is unable to copy the files from the Directory and throws an error msg which prompted me to find out why it’s happening

Error Message
image

How do I fix this please? TIA

Variables
currMyFiles =
image

files =
image

Activity

Windows Output export
image

Window Legacy Output exported
image

Hi,

As a workaround, can you try the following expression? This will remove 0x00 character at the end of the string.

Directory.GetFiles(currMyFiles).Select(Function(f) f.TrimEnd(Chr(0))).ToArray()

Is Z drive network drive? There might be cause for this.

Regards,

Thank you. Yeah Z drive is a mapped network drive

Hi,

Similar issue is reported in the following. It may be a bug of .net5/6.

Regards,

1 Like

@j8zel

Try using path.Combine(myFolder,Now.Year.ToString)

Cheers

Thank you Anil. I have added your suggestion.

1 Like

Thanks Yoichi! I was able to run my automation based on your coding. I also read the link you sent. Very informative. Cheers!

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