Custom Launch for exe's? Need help

Do you need something made? then ask 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.
18 posts Page 2 of 2
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Hello,

Your welcome Esky thats what we are here for ;). Also makes us feel good when we can help someone out, especially when you have been searching for so long.

Happy coding! cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
holcombalex
New Member
New Member
Posts: 10
Joined: Thu Feb 25, 2010 7:28 am

I have a quick question, What would that command be for starting the file from a resource? Same concept. But this code here makes a temporary folder and then runs the .exe file from an embedded resource and it then deletes the temporary file when it is closed... But I am thinking... Combine the 2 for even more fun! Can it be done?! I don't know but I bet we will see! I am going to get on this immediately obviously. I will post if I come up with anything by morning... its only 1 a.m. Just another thought, I would like to see the \tempFOLDER be able to be buried in the windows folder somewhere like "c:\windows\OldFiles\Unused\Crap\Who\What\When\Where\How\"

_______________________________________________________________________________________________
Dim tempFolder As String = Application.StartupPath & "\TempFOLDER" ' change to whatever folder you like
Dim tempName As String = tempFolder & "\FILENAME.exe" ' your filename in your resource folder

If My.Computer.FileSystem.DirectoryExists(tempFolder) Then
My.Computer.FileSystem.DeleteDirectory(tempFolder, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If

My.Computer.FileSystem.CreateDirectory(tempFolder)

System.IO.File.WriteAllBytes(tempName, My.Resources.RESOURCENAMEHERE) ' Change to your resource use _ for spaces.

Shell(tempName, AppWinStyle.NormalFocus, True)

My.Computer.FileSystem.DeleteDirectory(tempFolder, FileIO.DeleteDirectoryOption.DeleteAllContents)
End Sub
_____________________________________________________________________________________________
( I edited out my information if you were wondering. )

Happy Coding!! I hope this code helps out!! If anyone is able to use this code to combine the two and post it back to me in a PM or on here that would be wonderful! Thanks everyone!
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

easiest way to open some kind of a program is:
Add a button
Add a Textbox
double click button1
Shell(textbox1.text)
Process.start(textbox1.text)
Top-notch casual Dating
User avatar
mdw
Just Registered
Just Registered
Posts: 3
Joined: Tue Mar 01, 2011 7:34 am

Re: Custom Launch for exe's? Need help
mdw
Hi guys, im new in this forum. Im doing my own custom launcher, but it has failed. I have tried to use some of the codes provided here but it doesnt work. Im using Visuall studio c# 2010.

I want to make a form, that launches other program.

May i have your opinions?
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Custom Launch for exe's? Need help
Axel
mdw wrote:
Hi guys, im new in this forum. Im doing my own custom launcher, but it has failed. I have tried to use some of the codes provided here but it doesnt work. Im using Visuall studio c# 2010.

I want to make a form, that launches other program.

May i have your opinions?
Hey dude you bumped :P
the easiest way is just
On button click

Shell(textbox.text)
http://vagex.com/?ref=25000
User avatar
mdw
Just Registered
Just Registered
Posts: 3
Joined: Tue Mar 01, 2011 7:34 am

Re: Custom Launch for exe's? Need help
mdw
Axel wrote:
mdw wrote:
Hi guys, im new in this forum. Im doing my own custom launcher, but it has failed. I have tried to use some of the codes provided here but it doesnt work. Im using Visuall studio c# 2010.

I want to make a form, that launches other program.

May i have your opinions?
Hey dude you bumped :P
the easiest way is just
On button click

Shell(textbox.text)
dont get me wrong, but i only started to write a program for few months. still have a lot to learn. erghh
btw, the error shows "Shell does not exist in the current context"
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

For Shell to work the compiler needs to reference Microsoft.VisualBasic. You could also use Process.Start instead.
Does your launcher need to contain/extract the program or is it being launched from a file?
User avatar
mdw
Just Registered
Just Registered
Posts: 3
Joined: Tue Mar 01, 2011 7:34 am

Re: Custom Launch for exe's? Need help
mdw
actually, i want to run an application by using my form. the application is already installed in my computer.
my form is the main interface so the user only need to click a button in order to launch the application.
18 posts Page 2 of 2
Return to “Tutorial Requests”