Computing.Net > Forums > Programming > VB programs that execute .exe

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

VB programs that execute .exe

Reply to Message Icon

Original Message
Name: boonjap
Date: June 4, 2005 at 11:02:25 Pacific
Subject: VB programs that execute .exe
OS: XP
CPU/Ram: Pentium 4 / 512 MB
Comment:

I am trying to figure out how to write programs
with VB that will execute other .exe programs on my system (system manipulation). Can anyone
help me?

Happy coding!!


Report Offensive Message For Removal


Response Number 1
Name: StuartS
Date: June 4, 2005 at 11:11:21 Pacific
Reply: (edit)

There are three ways if running another programme from VB.

The simplest and easiest is to used the Shell command.

If you want more control over how the application runs use the ShellExecute API.

For total control use the CreateProcess API.

Instructions on how to use these different methods are available in either the VB help files or on Microsoft's Web site.

http://msdn.microsoft.com/

Stuart


Report Offensive Follow Up For Removal

Response Number 2
Name: InTRUdEr
Date: June 5, 2005 at 19:57:40 Pacific
Reply: (edit)

Extremly eazy in VB :)
This code will run Windows Notepad. Put this into button click event.

Private Sub Command1_Click()
Shell "notepad", vbNormalFocus
End Sub


Report Offensive Follow Up For Removal

Response Number 3
Name: secrets
Date: June 6, 2005 at 11:35:30 Pacific
Reply: (edit)

in my view createprocess is good one it will provide you with more control but its a bit advance for simple procedure use the shell()as suggested by InTRUdEr


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software