Page 2 of 2
Re: Custom Launch for exe's? Need help
Posted: Sun Dec 27, 2009 9:46 am
by CodenStuff
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;
Re: Custom Launch for exe's? Need help
Posted: Fri Mar 26, 2010 6:12 am
by holcombalex
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!
Re: Custom Launch for exe's? Need help
Posted: Sat Mar 27, 2010 12:11 am
by Agust1337
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)
Re: Custom Launch for exe's? Need help
Posted: Wed Mar 02, 2011 3:06 pm
by 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?
Re: Custom Launch for exe's? Need help
Posted: Wed Mar 02, 2011 3:08 pm
by 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)
Re: Custom Launch for exe's? Need help
Posted: Wed Mar 02, 2011 3:36 pm
by 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"
Re: Custom Launch for exe's? Need help
Posted: Wed Mar 02, 2011 10:00 pm
by mandai
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?
Re: Custom Launch for exe's? Need help
Posted: Thu Mar 03, 2011 1:45 am
by 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.