Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running batch file from VBA Code

Status
Not open for further replies.

mincefish

Programmer
Sep 27, 2001
74
GB
I'm sure this is a pretty straight forward thing to do - or at least I hope it is.
I would like to run a batch file (.bat) from within a module in Access 97 on Win2k. Ideally it would be something along the lines of:
1) User clicks button
2) Code decides which batch file to call (or even better, and perl file) (I am capable of doing these two bits, its the next bit I've no idea how to carry off!!)
3) batch file is called, and consequently runs (as if the user had gone into DOS, and typed the name of the batch file.)

I've looked in the Access help files, but to no avail. I've also searched the forums pretty hard, but again - I've not had any luck.

Any ideas?!

The mincefish.

-- Black holes are where God divided by zero
 
The syntax is ...

Shell("c:\your_path\your_batch.bat")
 
Thank you very much ETID....that's alot easier than declaring ShellExecute from shell32.dll....;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top