how to run exe

my question is that i want to just an exe file by clicking the command button.wht will be the code under the
command button.
hassansherazAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
bobbit31Connect With a Mentor Commented:
private sub Command1_Click()
   Shell "<path to exe>"
end sub
0
 
shakoor_hCommented:
Try this

Private Sub Command1_Click()
Shell "something.exe", vbNormalFocus
End Sub
0
 
SankerCommented:
Dim rc as double

Private Sub Command1_Click()
rc = Shell ("c:\example.exe", vbNormal)
End Sub
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Mr-BrownstoneCommented:
Hi
I hope it can help you cause it's really working:

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
Const ATTR_NORMAL = 0
Const ATTR_READONLY = 1
Const ATTR_HIDDEN = 2
Const ATTR_SYSTEM = 4
Const ATTR_VOLUME = 8
Const ATTR_DIRECTORY = 16
Const ATTR_ARCHIVE = 32

Private Sub Command1_Click()
          Call ShellExecute(hwnd, "Open", Something.exe, "", App.Path, 1)
End Sub


remember if you want to open a file from a directory you need to mention the directory.

if you need any help, I'll be very please to help you.

Mr.Brownstone
0
 
maverick_niksCommented:
Private Sub Command1_Click()
Shell "C:\Program Files\Microsoft Office\Office10\WinWord.exe", vbNormalFocus
End Sub
0
 
CleanupPingCommented:
hassansheraz:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
bobbit31Commented:
Recommendation: Points to bobbit31 (yes that's me, but look at the comments)
0
 
DanRollinsCommented:
Thanks for the input bobbit31.  Moderator, my recommended disposition is:

    Accept bobbit31's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0
All Courses

From novice to tech pro — start learning today.