[HELP] .exe From Resource[Solved]
Can i open a program .exe from my resources??
Like button1_click :
My.Resources.program
Some thing like that..If i can, please tell me how..
bud check the snippits vault next time but here_
Imports System.IO
Now this in a button click (or whet ever triggers the event)
Dim RPath As String = Application.StartupPath & "\File.exe" 'File.exe will be a temp name given to your exe, you can make it anything you want, or keep it as is.
' Will create the file with the given name
Using CreateFile As New FileStream(RPath, FileMode.Create)
CreateFile.Write(My.Resources.YourResource, 0, My.Resources.YourResource.Length)
End Using
' Start the application
Process.Start(RPath)
Note: "Your Resource" in my code example above needs to be the EXE name without the exe extension, so for example, if you add notepad.exe as a resource, then the code would be
Dim RPath As String = Application.StartupPath & "\File.exe"
Using CreateFile As New FileStream(RPath, FileMode.Create)
CreateFile.Write(My.Resources.Notepad, 0, My.Resources.Notepad.Length)
End Using
Process.Start(RPath)