|
-
Mar 23rd, 2010, 10:07 PM
#1
Thread Starter
Fanatic Member
How can i open a exe file in my resoure
I have a exe file in my resoure. How can i open it.(execute it)?
-
Mar 23rd, 2010, 10:16 PM
#2
Hyperactive Member
Re: How can i open a exe file in my resoure
Code:
Dim path As String = Application.StartupPath & "\temp.exe"
IO.File.WriteAllBytes(path, My.Resources.TheResourceFile)
Process.Start(path)
and then just delete the file when you're finished executing it (if you want)
-
Mar 23rd, 2010, 10:24 PM
#3
Thread Starter
Fanatic Member
Re: How can i open a exe file in my resoure
 Originally Posted by Philly0494
Code:
Dim path As String = Application.StartupPath & "\temp.exe"
IO.File.WriteAllBytes(path, My.Resources.TheResourceFile)
Process.Start(path)
and then just delete the file when you're finished executing it (if you want)
Thanks, i tried your way but it may be quite slowly,i thinks the reason is "writeallbytes" to new path , is there other way more quickly open that exe file ?
-
Mar 24th, 2010, 01:35 AM
#4
Addicted Member
Re: How can i open a exe file in my resoure
Write it to a MemoryStream instead...beware that if the size of the executable exceeds available memory, it might not be a nice idea after all. -.-
Anyone who has never made a mistake has never tried anything new. - Einstein
 Peace! 
-
Jun 22nd, 2010, 09:55 PM
#5
Hyperactive Member
Re: How can i open a exe file in my resoure
 Originally Posted by garyjohn_2000
Write it to a MemoryStream instead...beware that if the size of the executable exceeds available memory, it might not be a nice idea after all. -.-
I'm curious to see how this would be done, does anybody have an example of someone launching an executable into memory without writing it to its own file first?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|