Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB calling other programs!!!

Status
Not open for further replies.

cucswiz

Programmer
Jun 25, 2001
13
US
Does anyone know how to, within VB call other programs??? Specifically if I could open a command prompt and execute certain instuctions, that would be optimal. Anyone know how to do this in VB???? Or something similar??

 
You can also use the WinExec API
Private Declare Function WinExec Lib "kernel32" Alias "WinExec" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long

Private OpenProg As Long

OpenProg=WinExec("c:\program files\myfile.exe", 1)
 
I also found that if I wanted to add other information at the command prompt to write a bat file and call that from VB. Just a suggestion incase you wanted to do more than run an application.


Joanne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top