I am not sure I follow you.
I can't do much from info of "an error".
Have you stepped through the code line by line to see exactly what it's doing.
As for the 1st error. That's extremely simple to fix. However, if you are unable to fix this, then I am 110% sure that this code is a little difficult for you to implements.

Since you didn't give me the err num, or desc, I am going to assume that the error is because I am not adding "\" to the path.

Woka