(Q) How can I run a Dos BAT file from Access?
(A) An easy way is to use Shell. (Thanks Trevor Best!)
For example, if I have a batch file called "Test.bat", the
code from Access would look like
call Shell ( Environ$ ( "COMSPEC" ) & " /c c:\test.bat", vbNormalFocus)
Environ$("COMSPEC") returns the path to Command.com on the machine and the
"/c" argument makes sure that the Dos window is automatically closed when the
batch file finishes executing.
|