cmd batch file question



Greetings,

Apologies in advance for the cross-posting. I'm not certain which is the best group to post this to.

I don't use cmd.exe very much and I don't write batch files very often. Hopefully this is a simple question with a simple answer.

Here is a batch job which I can run at will, or as a scheduled task. The batch job starts MS Access, opens the specified file, and executes the specified macro (which, in turn, invokes a VB function in a module):

"C:\Program Files\Microsoft Office\Office11\msaccess.exe" "C:\MyFilePath\MyDatabaseName.mdb" /X MyMacroName
exit

Note that wrapping in certain newsreaders may make it appear that there is a carriage return after the call to msaccess.exe, but this is not actually the case. The only carriage return is before the exit command.

Can I modify this so that after the macro executes, the .mdb file closes, MS Access exits, and the cmd shell closes? Currently I have to close MS Access manually to return the focus to the shell, then the shell performs the exit command and closes on it's own.

Suggestions?
.



Relevant Pages

  • Batch File Help?
    ... Here is a batch job which I can run at will, ... Note that wrapping in certain newsreaders may make it appear that there is a carriage return after the call to msaccess.exe, but this is not actually the case. ... Currently I have to close MS Access manually to return the focus to the shell, then the shell performs the exit command and closes on it's own. ...
    (microsoft.public.office.developer.vba)
  • Re: How to identify the command line of batch jobs
    ... A "batch job" in Unix is something else, ... This works only if you will keep the shell session around and do ... not need to kill the jobs from another shell. ... You could also use the CMD output format with the -o flag to ps ...
    (comp.unix.questions)
  • Re: coulde anyone tell me what difference between "~/.bashrc" and "~/.bash_profile&qu
    ... non-interactive login is a cron or at batch job where the shell is not ...
    (comp.os.linux.questions)
  • Re: who exported this variable?
    ... I sometimes uncomment the first line in my .cshrc file: ... Some systems read a Bourne shell file even before starting ... a login shell, ... The exit command is used to make sure the echo/verbose flags are only set ...
    (comp.unix.shell)

Loading