PDA

View Full Version : Solved: run batch file from access



john3j
07-04-2009, 07:57 PM
I am trying to run a batch file from a macro in access. I have tried the following:

runApp
cmd.exe "C:\testbatch.bat"

This does not work. Can anyone help me figure out how to do this? Thanks.

OBP
07-05-2009, 05:53 AM
You use the Shell Function, this is from the VBA Help

Shell Function Example@import url(office.css);' Specifying 1 as the second argument opens the application in ' normal size and gives it the focus.
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1) ' Run Calculator.