PLEASE HELP need to get this done ASAP

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
11 posts Page 1 of 2
Contributors
User avatar
muttley1968
Hardcore Programmer
Hardcore Programmer
Posts: 622
Joined: Thu Jun 17, 2010 11:54 pm

Hello i need to know how to take a .exe file from program resources soo say i have like paint.exe in there and i wanted to move it form their to the desktop i did try using
file copy but wont work says something about bytes error hopefully get this done before morning and then program can be released to you and given to my work as they want it as well :P
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

hello muttley,

try this:
Code: Select all
'add this where you like button, form_load

'Where to copy to
Dim Path As String = System.Environment.SpecialFolder.Desktop & "\Paint.exe"

'Here we call you're paint.exe from the resource
Using sCreateFile As New FileStream(Path, FileMode.Create)
sCreateFile.Write(My.Resources.Paint, 0, My.Resources.Paint.Length)
End Using
hope this helps.

goodluck
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
muttley1968
Hardcore Programmer
Hardcore Programmer
Posts: 622
Joined: Thu Jun 17, 2010 11:54 pm

umm thanks dummy but when i press the button it crashes and says that the location was unhandled and it is runing in admin mode as well
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

Coz
Code: Select all
Path
is not a valid name for a string. Path is something else. Try to rename Path to Pathhie or Path123 then it should work.
Practice makes perfect!

VIP since: 6-10-2011
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

oops sorry for that, i just write the code fast
didn't think of that yea clanc is right.
path is a name that contains in vb already.
just rename it will work :)
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Try this :)
Code: Select all
Dim Path As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\Paint.exe"
System.IO.File.WriteAllBytes(Path, My.Resources.Paint)
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
muttley1968
Hardcore Programmer
Hardcore Programmer
Posts: 622
Joined: Thu Jun 17, 2010 11:54 pm

Download to the final program please have a look :P
http://www.mediafire.com/?3tdkq7r7f5pd63i
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

so did the code works?
to bad i can't run your app because i don't have java :D
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
muttley1968
Hardcore Programmer
Hardcore Programmer
Posts: 622
Joined: Thu Jun 17, 2010 11:54 pm

app should still work and should get java good for programing can code and debug at same time realtime update
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

:lol:
thats wasn't my question :p
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
11 posts Page 1 of 2
Return to “Coding Help & Support”