Copy a file in VB.net

I want to copy a file from a UNC path (ex: \\comname\dirname\filename.txt) to a local destination (c:\outputdir)

I have no compile errors, but when I run it, it throws an exception (System.IO.DirectoryNotFoundException). I'm absolutely sure the destination existst (it's referencing the destination directory). I've tried doing it with system.io.file.copy(source,dest) and my.computer.filesystem.copyfile(source,dest). Same result either way.

Post the code you are using along with the evaluated value of source and dest for File.Copy() . I have a number of apps that copy from UNC paths and they work OK, except for when the remote machine goes down. Then it throws an IOException . Does your code fail every time or just sometimes? It might be a sharing/permission issue.

destination.text contains a user specified output dir, in this case c:\output\ This produces a value of \\t1\system3\sys3error.log for sourcefile and c:\output\2234\January-14\T1\Error Log\ for destfile when i run it, it thows the exception System.IO.DirectoryNotFoundException, could not find part of path 'c:\output\2234\January-14\T1\Error Log\' I even commented out the destfile variable and change it to c:\testdir\ (which I created first). It throws the same error for that path, every time.

There's a different part of the code that checked which machines are on the network to avoid a network path not found exception, but for this example I'm only talking to \\T1\, and I will probably put a catch in if the file doesn't exist for some reason, but I just want to get the copy part working first.

I can navigate and have read/write access to both source and dest folders.

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...