SolvedDropping Specified .exe File

Posts 1–7 of 7 · Page 1 of 1
Dropping Specified .exe File
Hello, i was wondering , is it possible to create a form with a button that when we click it, it creates a .exe program in another project at desktop. im not so sure if you got what i mean but i will give more info if you ask. thanks in advance.
Yup, you need to explain clearly. I don't really get it.
@Amkay
Just add the .exe as a resource on your project. Then write that resource to the desktop path using System****.File.WriteAllBytes()
@Hassan ok lets say i made a program named p1. i want to make another one named p2 that has a button b1. i want each time i press b1, p1 is created on desktop. i think its clear now even if its a little complicated.

@Jason ok but can you tell me how to do that or is there a tut about it?
@Amkay: Alright. Do what Jason said. First, add the executable you want to be created on the desktop. Then, add these lines to your button:

Code:
Dim Filename As String = My.Computer.FileSystem.SpecialDirectories.Desktop & "\ExeNameHere.exe"
IO.File.WriteAllBytes(Filename,My.Resources.ResourceName)
This code will create the executable you added to your resources on the desktop. Just replace "ExeNameHere" with the desired name. Also, replace ResourceName with the name of the executable you added to resources.
@Hassan yeah it worked thanks man as always this section is the best for asking a questions. and @Jason thanks for help too
Good and NP.

Marked solved.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us