Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

execute an external application

Hi,

I have an external application: OTT89.exe. How to make a program in visual basic to execute this application? Thanks!

Comments

  • ninchagoraninchagora Posts: 82Member
    : Hi,
    :
    : I have an external application: OTT89.exe. How to make a program in visual basic to execute this application? Thanks!
    :

    There is SHELL statement in Basic.
    It starts the application, but it does not wait until the started app. has finished.
    I don't know how to make it wait.
  • GenjuroGenjuro Posts: 913Member
    : Hi,
    :
    : I have an external application: OTT89.exe. How to make a program in visual basic to execute this application? Thanks!
    :

    If you don't need to know when this app terminates, then calling Shell is enough:
    [code]Shell "[italic]Exe path[/italic]ott89.exe"[/code]

    You might not need the Exe part if either the EXE is in a directory referenced by the Path environment variable, or in the current directory (the same directory in which either the .vbp file is if you're debugging in the IDE, or the same directory as the EXE).
  • Maggie LiuMaggie Liu Posts: 4Member
    : : Hi,
    : :
    : :
    Thanks for your help. I have run Visual Basic using the Shell function. However, it did not start the application window. Since the application I tried to run is a DOS based program, could it be a problem to use the Shell function?

    Thanks!

    I have an external application: OTT89.exe. How to make a program in visual basic to execute this application? Thanks!
    : :
    :
    : If you don't need to know when this app terminates, then calling Shell is enough:
    : [code]Shell "[italic]Exe path[/italic]ott89.exe"[/code]
    :
    : You might not need the Exe part if either the EXE is in a directory referenced by the Path environment variable, or in the current directory (the same directory in which either the .vbp file is if you're debugging in the IDE, or the same directory as the EXE).
    :

  • GenjuroGenjuro Posts: 913Member
    :Thanks for your help. I have run Visual Basic using the Shell function. However, it did not start the application window. Since the application I tried to run is a DOS based program, could it be a problem to use the Shell function?

    Well, the DOS shell will remain open. It's a common problem with MS-Dos apps, but there are a few tricks.

    For instance, if I'm not wrong, you can Shell a .bat file; .bat files are plain text files, that contain MS-DOS commands; you could write one like this:

    [code]
    [italic]EXE pathEXE name[/italic]
    exit
    [/code]

    So that Visual Basic executes the .bat file, which in turn executes your exe and then exits.

    Again, if I'm not wrong.
  • GideonOmegaGideonOmega Posts: 617Member
    : :Thanks for your help. I have run Visual Basic using the Shell function. However, it did not start the application window. Since the application I tried to run is a DOS based program, could it be a problem to use the Shell function?
    :
    : Well, the DOS shell will remain open. It's a common problem with MS-Dos apps, but there are a few tricks.
    :
    : For instance, if I'm not wrong, you can Shell a .bat file; .bat files are plain text files, that contain MS-DOS commands; you could write one like this:
    :
    : [code]
    : [italic]EXE pathEXE name[/italic]
    : exit
    : [/code]
    :
    : So that Visual Basic executes the .bat file, which in turn executes your exe and then exits.
    :
    : Again, if I'm not wrong.
    :


    for the shell command try:
    [code]
    shell( "path and file name ie.. c:lah.exe",vbnormalfocus)
    [/code]
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • Maggie LiuMaggie Liu Posts: 4Member
    Thanks!



    : : :Thanks for your help. I have run Visual Basic using the Shell function. However, it did not start the application window. Since the application I tried to run is a DOS based program, could it be a problem to use the Shell function?
    : :
    : : Well, the DOS shell will remain open. It's a common problem with MS-Dos apps, but there are a few tricks.
    : :
    : : For instance, if I'm not wrong, you can Shell a .bat file; .bat files are plain text files, that contain MS-DOS commands; you could write one like this:
    : :
    : : [code]
    : : [italic]EXE pathEXE name[/italic]
    : : exit
    : : [/code]
    : :
    : : So that Visual Basic executes the .bat file, which in turn executes your exe and then exits.
    : :
    : : Again, if I'm not wrong.
    : :
    :
    :
    : for the shell command try:
    : [code]
    : shell( "path and file name ie.. c:lah.exe",vbnormalfocus)
    : [/code]
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :

Sign In or Register to comment.