Hi Phil,
There are several possible issues here. The first, of course, is that if
you're passing a literal string to Shell() you have to quote it, and
also quote any paths in the command that might contain spaces, e.g.
varAA = Shell("""C:\temp\Hello World.exe"" > ""C:\temp\hello.txt""")
I guess you're doing this but forgot to include the quotes in the
example you posted.
Normally one can ignore the return value, and therefore omit the
assignment. Also, it's often necessary to explicitly invoke the command
interpreter, with the /c switch to make it close after executing the
command, e.g.
Shell "cmd.exe /c ""C:\temp\Hello World.exe"" > ""C:\temp\hello.txt"""
The next thing is that by no means all DOS programs deliver their output
(either on-screen or printed) to the standard console or print devices
and therefore in a form that can be redirected. Virtually all serious
DOS applications address the screen directly (so they can run as
full-screen applications) and use their own printer drivers. Even your
helloworld.exe may not use the standard output.
So the real question is, can the legacy app be controlled from the DOS
prompt and made to write the report to a file? If so, you can put the
same commands into a .CMD file and use Shell("cmd.exe /c ...") to
execute it. If not, I think you're stuck.
Hope this helps.
>Hi -
>
[quoted text clipped - 22 lines]
>Many thanks in advance,
>Phil Freihofner, Albany CA
--
John Nurick [Microsoft Access MVP]
Please respond in the newgroup and not by email.