Home » questions » How do I call other appications (with arguments) from a VB 6 program?

How do I call other appications (with arguments) from a VB 6 program?

2006-07-31 10:37:15, Category: Programming & Design
I tried to use the Shell function and it works ok if I do not give any arguments to the program I want to use, but for example, I would like to open a PDF file with Acrobat Reader. I did something like the example in MSDN online: Shell("""C:\Program Files\Adobe\Acrobat\Reader\AcroRD32.exe"" my_pdf.pdf") But it doesn't work. I started thinking that I'm trying to do something in Windows, the Linux way (using shells) So if this is not the way to Open a new Program and tell it to open a file automatically, How can this be done? Thanks.

Answers

  1. TruthIsGod

    On 2006-07-31 11:16:59


    Shell (Chr(34) & "c:\program files\winamp\winamp.exe" & Chr(34) & " " & Chr(34) & "d:\my music\kennyg\kenny*" & Chr(34), vbNormalFocus)