David Gomes
David Gomes

Reputation: 919

Copy a File From Resources to Temp Folder

I'm making a VB application and I want to copy a file called "L3nEncrypt.jar" which is in resources of the application to the temp folder.

Right now I have this:

My.Computer.FileSystem.SpecialDirectories.Temp

which returns the temp folder.

Upvotes: 3

Views: 4211

Answers (2)

David Gomes
David Gomes

Reputation: 919

I found the solution

Imports System.IO
File.WriteAllBytes(My.Computer.FileSystem.SpecialDirectories.Temp & "/L3nEncrypt.jar", My.Resources.L3nEncrypt)

Upvotes: 2

Amen Jlili
Amen Jlili

Reputation: 1944

Use System.IO.File.Copy(SourceFileName,DestinationFileName)

The parameters are full file names of type string. Make sure that you're running the application with admin privileges so that the copying can be successful.

Upvotes: -1

Related Questions