shell program launch with file? 
Author Message
 shell program launch with file?

Hi.

I'm trying to launch an exe with a file to open on the launch.  The
FindExecutable find the right app for me fine (no probs there!) but
when it launches it, it doesn't open the file I requested...  Any ideas
why?   Should I be using ShellExecute instead, to find the associated
exe and launch with a file?

My code:
    iReturn = FindExecutable(szFilename, szPath, szExe)
    If iReturn = 31 Then
        MsgBox "There is no association for Hypertext Files (HTML)." + vbokayonly + vbInformation
        Exit Sub
    End If
    If iReturn = 0 Then
        MsgBox "The system is out of memory or resources." + vbokayonly + vbInformation
        Exit Sub
    End If

    szTemp = Trim(szExe) & " " & Trim(szFilename)
    iReturn = Shell(szTemp, 1)    ' Run with my file

Thanks for any pointers!
~ Mike

  http://www.*-*-*.com/ ~dinsmore/



Tue, 19 Jan 1999 03:00:00 GMT  
 shell program launch with file?


Quote:
>I'm trying to launch an exe with a file to open on the launch.  The
>FindExecutable find the right app for me fine (no probs there!) but
>when it launches it, it doesn't open the file I requested...  Any ideas
>why?   Should I be using ShellExecute instead, to find the associated
>exe and launch with a file?

[znip]

Quote:
>    szTemp = Trim(szExe) & " " & Trim(szFilename)
>    iReturn = Shell(szTemp, 1)    ' Run with my file

Debug and find out what szTemp contains. There may be some garbage,
because FindExecutable returns a null-terminated string. It would've
helped if you'd also shown your Dim's.

Not all pgms accept a file name in this way. Are you sure szExe does?

Greetings,

 ----------------------------------------
| I don't believe in a no-win scenario.  |
|               - Admiral James T. Kirk  |
 ----------------------------------------



Fri, 22 Jan 1999 03:00:00 GMT  
 shell program launch with file?

Re: shell program launch with file?

Did you put the filename after the command to boot the app ?



Wed, 27 Jan 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. launching a program using its registry entry NOT Shell()

2. VB3 shell() launches another copy same program...

3. determine if a program launched with the shell function completed

4. Launch associated file's program

5. Launching program AND file.

6. Create .EXE file to launch a windows program?

7. How to launch associated program with file ???

8. Launch .exe in Program Files

9. How to launch associated program with file ???

10. Launch program by file association

11. Launching Windows Program from DOS Program

12. Having a BASIC program launch another program

 

 
Powered by phpBB® Forum Software