Re: EXEC() Runs process in background




"Jim Michaels" <jmichae3@xxxxxxxxx> wrote in message
news:uJednQOjr726A0zenZ2dnUVZ_tmdnZ2d@xxxxxxxxxxxxxx
> "Robin Haswell" <rob@xxxxxxxxxxxxxxxxxx> wrote in message
> news:pan.2006.01.19.11.11.02.478252@xxxxxxxxxxxxxxxxxxxxx
>> On Tue, 17 Jan 2006 23:56:47 +0000, Andy Hassall wrote:
>>
>>> On 17 Jan 2006 15:16:52 -0800, giloosh99@xxxxxxxxx wrote:
>>>
>>>>Exec, shell_exec, system, popen functions all run the process in the
>>>>background.
>>>
>>> They don't normally, unless you do something fairly specific to get
>>> them to.
>>>
>>>>how can i get it to run the process normally.
>>>>my code looks like this:
>>>><?
>>>>exec("batch_file.bat");
>>>>?>
>>>>
>>>>am i doing anything wrong?
>>>
>>> What's in batch_file.bat?
>>
>>
>> I think your problem is MS Access is forking and running in the
>> background, causing the BAT to exit.
>
>
> do a start, run, cmd to get a cmd shell.
> type in start /?
> and look at your options. I think you can get the batch file to wait for
> the process to finish before continuing.
> and BTW, use .CMD instead of .BAT - it will give you these options. I
> can't remember if .BAT files bring up command.com rather than cmd.exe. I
> think they do. that is, if you are on an NT/2000/xp box. .CMD files will
> also give you long filenames by default, and a bunch of extra commands and
> switches. try doing a set /? and watch the fireworks. batch files can
> loop and count and do calculations with CMD. (I'm sure this won't impress
> the UNIX folk :-) )
>

try
start /wait somefile.mdb /x somemacro
in your .cmd file. it might also work in your .BAT file.


>
>>
>> Open up a command window and run your bat file in it. How long before
>> your
>> BAT exits and goes back to the command prompt? If the answer is "before I
>> close MS Access", then there's nothing you can do about it.
>>
>> -Rob
>>
>
>


.



Relevant Pages

  • Re: How To Execute Batch File Line By Line
    ... COMMAND /C string Carries out the command specified by string, ... CMD /C Carries out the command specified by string and then terminates. ... Both .cmd and .bat files work on Windows NT versions. ... File Description MS-DOS Batch File ...
    (microsoft.public.windowsxp.general)
  • Re: VFP 6 - problem with RUN command
    ... I think you simply need to de-bug your .bat file. ... Toos VFP to the side for ... The PAUSE command, however, functions beautifully now. ... and a CALL command to another batch file doesn't work, ...
    (microsoft.public.fox.programmer.exchange)
  • Re: VFP 6 - problem with RUN command
    ... Does your .BAT file run OK if you run it from Windows Explorer? ... and a CALL command to another batch file doesn't work, ... If I place a SUSPEND command immediately before the RUN command, ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Shell & VBA
    ... run the command. ... > SHELL command. ... > When manually I execute this batch file, ...
    (microsoft.public.excel.programming)
  • Re: Command Line Question about Renaming Files
    ... It had to do with how I was sending the commands to the command processor. ... this bat file to work. ... It does rename itself in the process and generates an error, ... I don't fully understand how your batch file works, ...
    (microsoft.public.win2000.general)