Results 1 to 7 of 7

Thread: Simple ShellExecute Problem (really easy) [RESOLVED]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2004
    Posts
    146

    Simple ShellExecute Problem (really easy) [RESOLVED]

    Hi,

    I've been having trouble, and, being new to VB, I can't figure out how to simply load a new exe after the first exe is loaded. How do I do this? I've gathered that you have to use ShellExecute, but my searches on these boards and on google have only turned up variations of the code that don't seem to work too well.

    For example, I run "A.exe". A.exe, when I click a button, will open "B.exe". This should be really easy for you guys...

    Thanks.
    Last edited by rehto; Mar 21st, 2004 at 10:19 PM.

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Can you use (non API) Shell()?

    Like: Shell(b.exe, vbNormalFocus)




    Bruce.

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Are you asking how to shell external program from your own application or what ??? Unclear ...

    In any case, here is a quick sample:
    VB Code:
    1. Private Sub Command1_Click()
    2.     Shell "calc.exe", vbNormalFocus
    3. End Sub

    edit: Bruce, sorry for cross posting.

  4. #4
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    I screwed up anyway by including the brackets (used if using Call)

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2004
    Posts
    146
    Thanks all,

    RhinoBull's code was what I needed.

    Now wasn't that easy? Sorry for wasting your time.

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Oh silly you, Bruce ...

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132
    Originally posted by rehto
    ... Now wasn't that easy? Sorry for wasting your time.
    It's easy enough when you know it ... Don't hesitate to ask as many questions as you need regardless.

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width