Shell Functions and DOS executables



I'm running a DOS executable from a VB Shell function.

vCnvrtWFMResponse = Shell("cnvrtwfm -l " & InputPathFile,
vbNormalFocus) 'Call the app

The DOS executable converts a file from one format to another.

If it's successful, it looks like this (at the DOS prompt):
cnvrtwfm -l tek00001.wfm
Creating tek00001.dat

It it's unsuccessful, it looks like this (at the DOS prompt):
cnvrtwfm -l tek00001.wfm
Error Converting tek00001.wfm

As you can see, the DOS executable informs the user how things worked
out.

The Shell Function, of course, reports the taskID if it was
successful. However, it's definition of "successful" isn't the same
as my DOS executable. ;-)

Ideally, I'd like to retrieve the command line from the Shell
Function and interrogate the string myself. Another alternative is
to look of the converted file with a DIR Function. This seems kind
of crude.

How can I retrieve the command line output of a Shell'ed DOS
executable?

Any suggestions?
.



Relevant Pages

  • Re: Call Shell() vs. var = Shell()
    ... Runs an executable program and returns a Variant representing ... the program's task ID if successful, otherwise it returns zero. ... > call the Shell function: ...
    (microsoft.public.access.formscoding)
  • Re: Another Button (link to website)
    ... Put this line of code in the On Click Event of the command button you want to ... The Shell function starts an application, ... VBA Help will give you more info if you need it. ... Private Sub cmdPayPal_Click ...
    (microsoft.public.access.modulesdaovba)
  • Re: shell function over network drive
    ... I will try your suggestion with the run command. ... you suspected I did not reinstall Microsoft Word - but that first part ... This shell function works fine if the file is on the C: ...
    (comp.databases.ms-access)
  • Re: Launch external file based on cell value
    ... You can use the Shell function to run a program. ... The following code will run "C:\Test\Test.exe" passing it a switch parameter whose value comes from column "C" of the row of the ActiveCell. ... Pearson Software Consulting LLC ... I want to be able to launch this file via command line code: "C:\Program ...
    (microsoft.public.excel.programming)
  • Need Help with Call Shell("cmd /K netstat") Function!!!
    ... I have found a better solution using a script based FTP ... using the Command Prompt the "Call Shell" function to be exact. ... however come into a problem with using the Call Shell function. ...
    (microsoft.public.excel.programming)