?
Solved

how to run exe

Posted on 2003-02-19
8
Medium Priority
?
174 Views
Last Modified: 2010-05-01
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.
0
Comment
Question by:hassansheraz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 150 total points
ID: 7983311
private sub Command1_Click()
   Shell "<path to exe>"
end sub
0
 

Expert Comment

by:shakoor_h
ID: 7983323
Try this

Private Sub Command1_Click()
Shell "something.exe", vbNormalFocus
End Sub
0
 
LVL 1

Expert Comment

by:Sanker
ID: 7983796
Dim rc as double

Private Sub Command1_Click()
rc = Shell ("c:\example.exe", vbNormal)
End Sub
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:Mr-Brownstone
ID: 7984169
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
 

Expert Comment

by:maverick_niks
ID: 7984178
Private Sub Command1_Click()
Shell "C:\Program Files\Microsoft Office\Office10\WinWord.exe", vbNormalFocus
End Sub
0
 

Expert Comment

by:CleanupPing
ID: 8901427
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
 
LVL 18

Expert Comment

by:bobbit31
ID: 8902970
Recommendation: Points to bobbit31 (yes that's me, but look at the comments)
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8959697
Thanks for the input bobbit31.  Moderator, my recommended disposition is:

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

DanRollins -- EE database cleanup volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question