RE: Copy file & Move to directory [HELP] 10-17-2016, 06:16 AM
#8
(10-16-2016, 03:38 AM)Killpot Wrote:(10-15-2016, 12:10 PM)Skryptec Wrote: Hello everyone,
I have been stuck on this part for ages and can't seem to fix it.
Code:Dim AppData As String = GetFolderPath(SpecialFolder.ApplicationData + "\Fevino") Dim FilePath As String = Application.ExecutablePath() If System.IO.File.Exists(FilePath) = True Then System.IO.File.Copy(FilePath, AppData, True) End If
Basically what I want it do, is copy the application and then place it into AppData, but for some reason the code above gives me a error.
"C:\Users\Gebruiker\AppData\Fevino" is a directory and not a file.
Help is appreciated.
the reason this is happening is because File.Copy does not preserve file name, you have to give it a name in the destination directory, you're basically trying to tell the system to copy your current exe and place it in the destination as a directory.
Yeah, I already fixed it, thanks though










![[Image: oAqtc2l.png]](https://i.imgur.com/oAqtc2l.png)
![[+]](https://sinister.li/images/modern/collapse_collapsed.png)