-
Dec 10th, 2015, 05:17 AM
#1
Thread Starter
Member
How To Lunch exe program from vb project in any PC
Hello Guys i want to make Project filled with exe files can any one use it in any pc iam using vb2010 Express
Any Solution?
-
Dec 10th, 2015, 06:57 AM
#2
Re: How To Lunch exe program from vb project in any PC
I think you need to provide a more detailed explanation of what you're trying to
-
Dec 10th, 2015, 06:59 AM
#3
Re: How To Lunch exe program from vb project in any PC
If all you're asking is how to run a program from code then the answer is to call Process.Start.
-
Dec 10th, 2015, 07:10 AM
#4
Thread Starter
Member
Re: How To Lunch exe program from vb project in any PC
Originally Posted by jmcilhinney
I think you need to provide a more detailed explanation of what you're trying to
Look! i need to make program which has a collection for programs exe if the user click in a button the program Open in any pc
i try this code BUt it open in my pc only if i used in any pc Error Appear
HTML Code:
Process.Start("C:\path_to\myapp.exe")
Like that program when i click on the Run Beethink Setup Program Appear and the folder of program have the setup exe file
-
Dec 10th, 2015, 07:28 AM
#5
Re: How To Lunch exe program from vb project in any PC
I think you need to use a bit of common sense here. That code is going to work on any machine as long as the app you specify to run exists. If it doesn't exist then obviously it can't run. Unless you can provide some meaningful information about the error that suggests otherwise, I can only assume that the program you're specifying doesn't exist.
-
Dec 10th, 2015, 07:46 AM
#6
Thread Starter
Member
Re: How To Lunch exe program from vb project in any PC
Originally Posted by jmcilhinney
I think you need to use a bit of common sense here. That code is going to work on any machine as long as the app you specify to run exists. If it doesn't exist then obviously it can't run. Unless you can provide some meaningful information about the error that suggests otherwise, I can only assume that the program you're specifying doesn't exist.
Bro How this code will Work if the Onther user dont have the Path file on his Pc
-
Dec 10th, 2015, 07:53 AM
#7
Re: How To Lunch exe program from vb project in any PC
Originally Posted by AbdelazizOmar
Bro How this code will Work if the Onther user dont have the Path file on his Pc
It won't, and why would you expect it to? You can't magically run software on a computer that isn't there. If you want to run a program then the program has to actually be there. It's that simple.
-
Dec 10th, 2015, 07:57 AM
#8
Thread Starter
Member
Re: How To Lunch exe program from vb project in any PC
Originally Posted by jmcilhinney
It won't, and why would you expect it to? You can't magically run software on a computer that isn't there. If you want to run a program then the program has to actually be there. It's that simple.
Yep i will Upload the Program Files with my app.exe Folder so from the program in just click the program open so Now The Above Code will Work ? if work How i can Use it ?
-
Dec 10th, 2015, 08:05 AM
#9
Re: How To Lunch exe program from vb project in any PC
Originally Posted by AbdelazizOmar
Hello Guys i want to make Project filled with exe files can any one use it in any pc iam using vb2010 Express
Any Solution?
Originally Posted by AbdelazizOmar
Look! i need to make program which has a collection for programs exe if the user click in a button the program Open in any pc
i try this code BUt it open in my pc only if i used in any pc Error Appear
HTML Code:
Process.Start("C:\path_to\myapp.exe")
Like that program when i click on the Run Beethink Setup Program Appear and the folder of program have the setup exe file
Originally Posted by AbdelazizOmar
Bro How this code will Work if the Onther user dont have the Path file on his Pc
I'm going to take all of these statements together, apply some assumptions, mix in a blender and see if I can come out with the more correct solution...
It sounds like you want to package multiple pre-existing apps into your app, then have your application extract them and run them when the user clicks a button. That's what installers are for. I don't recommend writing your own, because there are parts of the system it needs to write to (potentially) that Windows isn't going to let you have access to (but a properly registered installer would).
Also, a lot of viruses work this way... by packaging themselves inside another app... so it's possible that your app could get flagged as a potential threat.
-tg
-
Dec 10th, 2015, 09:02 AM
#10
Re: How To Lunch exe program from vb project in any PC
I think he means he has a program and there will be other exe files in the deployed folder that his app will want to be able to run, if so then Application.StartupPath is what he's looking for when calling any of those other exe files.
-
Dec 10th, 2015, 11:13 AM
#11
Thread Starter
Member
Re: How To Lunch exe program from vb project in any PC
Originally Posted by JuggaloBrotha
I think he means he has a program and there will be other exe files in the deployed folder that his app will want to be able to run, if so then Application.StartupPath is what he's looking for when calling any of those other exe files.
Yep JuggaloBrotha You Know my request
-
Dec 16th, 2015, 12:38 PM
#12
Thread Starter
Member
Re: How To Lunch exe program from vb project in any PC
Any Useful Answer? i Have A Program and i want to Fill it With a Programs Any User in any Pc Can Open The Program from My Program i have made it Like That Video !>>> https://youtu.be/e7TAX7JxefI
-
Dec 16th, 2015, 12:52 PM
#13
Re: How To Lunch exe program from vb project in any PC
Originally Posted by AbdelazizOmar
Any Useful Answer? i Have A Program and i want to Fill it With a Programs Any User in any Pc Can Open The Program from My Program i have made it Like That Video !>>> https://youtu.be/e7TAX7JxefI
I thought we already answered this, you have the exe files in the same folder as your app's exe file (I'm assuming an installer will guarantee that), then when the user selects (or does whatever to run) one of the programs you combine the Application.StartupPath with the exe file and and pass it to a Process.Start() to run it.
You can even use Directory.GetFiles() with Application.StartupPath to get the list of files as needed too.
-
Dec 16th, 2015, 04:02 PM
#14
Thread Starter
Member
Re: How To Lunch exe program from vb project in any PC
Originally Posted by JuggaloBrotha
I thought we already answered this, you have the exe files in the same folder as your app's exe file (I'm assuming an installer will guarantee that), then when the user selects (or does whatever to run) one of the programs you combine the Application.StartupPath with the exe file and and pass it to a Process.Start() to run it.
You can even use Directory.GetFiles() with Application.StartupPath to get the list of files as needed too.
Bro iam Beginner! Can You Explain To me by Steps Or Photo ?
-
Dec 16th, 2015, 06:17 PM
#15
Re: How To Lunch exe program from vb project in any PC
Originally Posted by AbdelazizOmar
Bro iam Beginner! Can You Explain To me by Steps Or Photo ?
You're a beginner, not a vegetable. You've been told exactly what to do so now is where you make an effort to do it. Don't just assume that you can't and expect others to do for you. If you have an issue, then you can post what you've tried and we can tell you how to correct it.
-
Dec 17th, 2015, 02:00 PM
#16
Thread Starter
Member
Re: How To Lunch exe program from vb project in any PC
Originally Posted by jmcilhinney
You're a beginner, not a vegetable. You've been told exactly what to do so now is where you make an effort to do it. Don't just assume that you can't and expect others to do for you. If you have an issue, then you can post what you've tried and we can tell you how to correct it.
Bro How can i get Directory.GetFiles() with Application.StartupPath ?? Which code can i use which steps can i do ?
-
Dec 17th, 2015, 02:53 PM
#17
Re: How To Lunch exe program from vb project in any PC
Originally Posted by AbdelazizOmar
Bro How can i get Directory.GetFiles() with Application.StartupPath ?? Which code can i use which steps can i do ?
Directory.GetFiles Method (String) (System.IO)
Application.StartupPath Property (System.Windows.Forms)
If that's too advanced for you, I'd suggest learning up on vb.net and programming in general: VB.Net Tutorial
Last edited by JuggaloBrotha; Dec 17th, 2015 at 02:56 PM.
-
Dec 17th, 2015, 05:53 PM
#18
Re: How To Lunch exe program from vb project in any PC
Originally Posted by AbdelazizOmar
Bro How can i get Directory.GetFiles() with Application.StartupPath ?? Which code can i use which steps can i do ?
Bro, did you put any thought into it? What does Directory.GetFiles do? Have you made any effort to find out? It takes a folder path and returns an array of file paths for the files in that folder. What does Application.StartupPath do? Have you made any effort to find out? It returns a folder path. Can you put 2 and 2 together? If you sit there and expect the information to come to you then you should not be surprised when you get no information.
-
Dec 17th, 2015, 06:16 PM
#19
Thread Starter
Member
Re: How To Lunch exe program from vb project in any PC
Originally Posted by jmcilhinney
Bro, did you put any thought into it? What does Directory.GetFiles do? Have you made any effort to find out? It takes a folder path and returns an array of file paths for the files in that folder. What does Application.StartupPath do? Have you made any effort to find out? It returns a folder path. Can you put 2 and 2 together? If you sit there and expect the information to come to you then you should not be surprised when you get no information.
i DOn't know information! BUt i post thread here to get help how can i do it all told me Do that : Directory.GetFiles() with Application.StartupPath ??
But How? Are Directory.getfiles that i should upload the files to it or what? there any video or pdf website explain that ?
-
Dec 18th, 2015, 11:30 AM
#20
Re: How To Lunch exe program from vb project in any PC
Originally Posted by jmcilhinney
Bro, did you put any thought into it? What does Directory.GetFiles do? Have you made any effort to find out? It takes a folder path and returns an array of file paths for the files in that folder. What does Application.StartupPath do? Have you made any effort to find out? It returns a folder path. Can you put 2 and 2 together? If you sit there and expect the information to come to you then you should not be surprised when you get no information.
Originally Posted by AbdelazizOmar
i DOn't know information! BUt i post thread here to get help how can i do it all told me Do that : Directory.GetFiles() with Application.StartupPath ??
But How? Are Directory.getfiles that i should upload the files to it or what? there any video or pdf website explain that ?
Guys, I've already linked him to the documentation that explain exactly (even has code examples) for each of the things mentioned:
Originally Posted by JuggaloBrotha
It's up to him to show some effort now.
-
Dec 18th, 2015, 04:24 PM
#21
Thread Starter
Member
Re: How To Lunch exe program from vb project in any PC
Originally Posted by JuggaloBrotha
Guys, I've already linked him to the documentation that explain exactly (even has code examples) for each of the things mentioned:It's up to him to show some effort now.
Ok Bro i have Onther idea to make ....... i want the User slecet the file from button and the path file appear in text then he click in Open file the program OPen and button to save changes like that photo Which Codes can i Use
For File path= ! ?
For Open File- ! ?
For Save Changes = !? when he open the program again he will find the program selected so when click in open the program open .
Last edited by AbdelazizOmar; Dec 18th, 2015 at 04:36 PM.
-
Dec 18th, 2015, 04:41 PM
#22
Re: How To Lunch exe program from vb project in any PC
Originally Posted by AbdelazizOmar
Ok Bro i have Onther idea to make ....... i want the User slecet the file from button and the path file appear in text then he click in Open file the program OPen and button to save changes like that photo Which Codes can i Use
For File path= ! ?
For Open File- ! ?
For Save Changes = !? when he open the program again he will find the program selected so when click in open the program open .
You can use an OpenFileDialog for getting the file (program) to run.
Then in the other button you can use Process.Start() to run it.
-
Dec 18th, 2015, 05:07 PM
#23
Thread Starter
Member
Re: How To Lunch exe program from vb project in any PC
Originally Posted by JuggaloBrotha
Bro now i have Code for Browisng file
Code:
Dim dialog As New OpenFileDialog()
If DialogResult.OK = dialog.ShowDialog Then
TextBox1.Text = dialog.FileName
End If
Now i need Code for Button2 ( OPen file path you Selected) which the file that user select from Button1 To Make Program Open...... Which Code can i use can you Direct and give me the code
Last edited by AbdelazizOmar; Dec 18th, 2015 at 05:13 PM.
-
Dec 19th, 2015, 04:50 PM
#24
Re: How To Lunch exe program from vb project in any PC
Process.Start(TextBox1.Text)
Process.Start(Application.StartupPath & "\MyApp.exe")
-
Dec 21st, 2015, 11:11 AM
#25
Re: How To Lunch exe program from vb project in any PC
Originally Posted by AbdelazizOmar
Bro now i have Code for Browisng file
Code:
Dim dialog As New OpenFileDialog()
If DialogResult.OK = dialog.ShowDialog Then
TextBox1.Text = dialog.FileName
End If
Now i need Code for Button2 ( OPen file path you Selected) which the file that user select from Button1 To Make Program Open...... Which Code can i use can you Direct and give me the code
*le sigh*
vb.net Code:
Imports System.IO
Public Class Form1
Private m_Process As Process
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
TextBox1.ReadOnly = True
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim ProgramFileName As String = Path.GetFileName(Application.ExecutablePath).ToLower
Using ofd As New OpenFileDialog With {.InitialDirectory = Application.StartupPath, .Title = "Select a program to run", .DefaultExt = "exe", .Filter = "Exe Files|*.exe", .AddExtension = True}
If ofd.ShowDialog(Me) <> DialogResult.Cancel AndAlso Not ofd.FileName.ToLower.EndsWith(ProgramFileName) Then TextBox1.Text = ofd.FileName
End Using
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
m_Process = Process.Start(TextBox1.Text)
End Sub
End Class
That's only for using an OpenFileDialog, like was discussed before, you can load those program's file names into something like a ComboBox that way the available options are given to them and you simply grab the file name selected and append the Applicatio.StartupPath and run it.
Tags for this Thread
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
|