Results 1 to 7 of 7

Thread: open a exe file from a vb program?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Posts
    30

    open a exe file from a vb program?

    hi, is there anyway to start a program from vb, and in the same time have a input file for that program to open?

    like if I got a file hello.txt and want notepad to open it?

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Use the Shell command.
    VB Code:
    1. Shell "Notepad.exe c:\thePath\Hello.txt", vbNormalFocus
    You can also use the ShellExecute API function.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Posts
    30

    if...?

    if I got a string variable that have the path and all how do I use that then?

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    VB Code:
    1. Shell "Notepad.exe " & TheStringVariable, vbNormalFocus

  5. #5
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Something like this:

    VB Code:
    1. Shell "Notepad.exe " & Path_To_The_File_And_Its_Name, vbNormalFocus
    Baaaaaaaaah

  6. #6
    New Member
    Join Date
    Oct 2001
    Location
    china
    Posts
    2
    Yes! Just the Shell

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Posts
    30

    thx

    thx to you all for answer my stupid questions =)

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