Shell() or Windows API question

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: RK (anonymous_at_discussions.microsoft.com)
Date: 05/18/04


Date: Mon, 17 May 2004 20:19:25 -0700

Shell() cmd "my.bat" /c

>-----Original Message-----
>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: NTVDM hard error on Windows 2003 Server SP1
    ... Windows 2003 Server SP1 platform, there is a pop-up box with the error ... run regedit.exe from a DOS window command prompt. ... The server is not a domain controller, and is on a LAN with a Windows ...
    (microsoft.public.windows.server.general)
  • Re: Shell to Command
    ... > I have a VB6 program that shells to the dos prompt then opens an ftp ... > manually start a dos session and type in the command line ftp, ... Am I missing something in the shell function? ...
    (microsoft.public.vb.syntax)
  • Re: Wildcard on Folder Name
    ... This is not DOS - it is the Command Prompt. ... Microsoft Windows XP - Command-line reference A-Z ... Microsoft Windows XP - MS-DOS subsystem commands ...
    (microsoft.public.windowsxp.general)
  • Re: "Read-only" Folders
    ... "Dos attrib command" - that's why. ... anti-Windows folks tell me that Windows is ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Shell function - accessing an Access secure db (.MDW file)
    ... > Hi - Does anyone know the correct syntax for the shell function. ... You can use the Shell command. ... To execute internal DOS command (Dir, Copy, ... Private Declare Function OpenProcess _ ...
    (microsoft.public.vb.general.discussion)