It certainly looks like a mistake on the website. That shouldn't stop us, though; just put the directory and filename into the same parameter:
My.Computer.FileSystem.CopyFile("C:\UserFiles\TestFiles\test.txt", "C:\UserFiles\TestFiles2\NewFile.txt", FileIO.UICancelOption.DoNothing)
(If you want to force an overwrite, change the third parameter to True
. I don't know that you can overwrite and pass CancelOption.DoNothing
in the same call.)