English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to run an application from vb 6.0 program.
Like when i click on some button some application like window's word or calculator should start.
Can anyone help me for this code?

2007-01-21 15:32:06 · 3 answers · asked by Tapan 1 in Computers & Internet Programming & Design

3 answers

use Shell Command to execute the outer exe files from Visual basic
syntax:

shell "c:\windows\calc.exe" - for calculator (Give correct path of calc)

2007-01-21 15:45:40 · answer #1 · answered by Govarthanan R S 2 · 0 0

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Call ShellExecute(Me.hwnd, "Open", ExecutablesPath$, "", DirToExecuteIn$ & Chr$(0), 1)

This method allows you to pass a file and have it opened with the appropriate app. If you just want to run a windows app that is in the path it's easier ...

Shell "notepad.exe", vbNormalNoFocus

will run notepad.

Where ExecutablesPath$ contains the location of the file and DirToExecuteIn$ contains the directory to "Start it up" in. the "" is for paremeters to go in to be passed to the executable should you need to do that.

2007-01-21 23:43:41 · answer #2 · answered by b_plenge 6 · 0 0

Use a shell statement.

Shell(C://Windows/calculator.exe) or whatever the file path to your program is

2007-01-21 23:47:02 · answer #3 · answered by rod 6 · 0 0

fedest.com, questions and answers