• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

Opening a file or an application

I now use:

Private 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

with -
ShellExecute Me.hwnd, "Open", Link, 0&, 0&, 5

to open an internet site or to bring up a file in an application.  How can I change this to only open applications in my computer?
0
Lee5
Asked:
Lee5
  • 2
1 Solution
 
Erick37Commented:
If you only want to run an application you can use the Shell command:

Call Shell("c:\windows\notepad.exe", vbNormalFocus)
0
 
phairat2000Commented:
We can run all application on windows application or dos application with command "Shell" . This is an example ,Uses to run Bat File and PKZIP.EXE >>>

CopyStr = pPathBase + "copy.bat"
    focus = Shell(CopyStr)
   
    ShellStr = pPathBase & "pkzip.exe " & pPathBkup & BkupName & " " & pPathBase & "db_bks.mdb"
   
 focus = Shell(ShellStr, 3)
0
 
Erick37Commented:
Hmmmm...
0
 
sonalchouhanCommented:
use shell

dim retval

retval = shell("C:\Program Files\Internet Explorer\Iexplore.exe")

all the best



0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now