Shell() or Windows API question

From: gxdata (il_thomas_at_hotmail.com)
Date: 05/18/04


Date: Tue, 18 May 2004 11:02:21 +0800

I have a DOS or command console program that was written in FORTRAN, and
accepts piped input when run from Windows 2000 Pro command prompt (or
Windows 98 DOS prompt) -

INVERSE.EXE < INPUT.TXT
Running the above from DOS / command prompt works perfectly.

Also, this works from an Access XP code module -
   RetVal = Shell("O:\Vincenty\inverse.exe", 1)
giving just the console interface and requiring manual input; but I need to
pipe in the values stored in a file INPUT.TXT (or - better - pass a string
direct from a routine written in Access Visual Basic).

I can't discover a way to achieve what I want from an Access subroutine. I
have tried Shell() with both direct and with various batch files -
   RetVal = Shell("O:\Vincenty\inverse.exe < 1.TXT", 1)
or
   RetVal = Shell("O:\Vincenty\inverse.exe < 1.TXT", 1)
and
   RetVal = Shell("MyBatchFile1.BAT < INPUT.TXT", 1)
or
   RetVal = Shell("MyBatchFile2.BAT", 1)

where the batch files are 1 - inverse.exe < %1 and 2 - inverse.exe <
INPUT.TXT

Everything run with Shell() from Access fails, when redirection (piped
inout) is specifdied - either directly or through a batch file. Note that
both of the batch files described above do work perfectly when run manually
from the DOS (command) prompt.

I think I need some Windows API functions, and fairly elaborate ones. I
would appreciate suggestions.

Ian Thomas
Perth, Australia



Relevant Pages

  • RE: run a batch file
    ... "Prevents users from running the interactive command prompt, ... Do not prevent the computer from running batch files if the ... "Limits the Windows programs that users have permission to run on the ... add to the List of Allowed Applications. ...
    (microsoft.public.win2000.general)
  • RE: run a batch file
    ... "Prevents users from running the interactive command prompt, ... Do not prevent the computer from running batch files if the ... "Limits the Windows programs that users have permission to run on the ... add to the List of Allowed Applications. ...
    (microsoft.public.win2000.group_policy)
  • Reboot to Command Prompt?
    ... and I even have a small series of batch files. ... winlogon, but it could very well be kernel.dll) clean it, and restart ... into a command prompt seems to be the easier way. ... set windows to reboot directly to a command prompt. ...
    (microsoft.public.scripting.wsh)
  • Re: XP replacement for Bat files
    ... not what other options you besides batch files. ... > In the DOS environment, this directory string fails on the Office ... This adds weight to the theory that Micros~1 is not the Microsoft Office ... it's a command prompt window. ...
    (microsoft.public.windowsxp.basics)
  • Re: DOS applications ?
    ... A DOS batch file runs dos programs sequentially and can run ... command prompt window and keep the second command ... Windows APIs to do it. ... A 16-bit DOS app running on pure MS-DOS cannot launch another app ...
    (microsoft.public.vc.mfc)