UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Run Batch File From Within VBA ?, Access 2010    
 
   
bakersburg9
post Nov 12 2012, 03:32 PM
Post#1



Posts: 5,381
Joined: 2-November 04
From: Downey, CA


Would it be possible to run an MS-DOS batch file from within VB code in MS-Access 2007/2010?
e: the batch file is called C:\BATCH\runme.bat ??
Go to the top of the page
 
strBean
post Nov 12 2012, 04:00 PM
Post#2


UtterAccess VIP
Posts: 4,892
Joined: 25-September 02
From: Washington State


Certainly
!--c1-->
CODE
Shell "C:\BATCH\runme.bat"

There is an optional Window Style argument that defaults to vbMinimizedFocus. Read up on the Shell function to see how it suits you best.
Hope this helps.
Go to the top of the page
 
Doug Steele
post Nov 12 2012, 04:02 PM
Post#3


UtterAccess VIP
Posts: 22,163
Joined: 8-January 07
From: St. Catharines, ON (Canada)


Try:
!--c1-->
CODE
Dim iReturnValue As Integer
  
  iReturnValue = Shell("C:\BATCH\runme.bat")

Look up Shell in the Help file: there's actually an optional second parameter WindowStyle that controls how the style of the window in which the file runs.
Go to the top of the page
 
philipq
post Jan 16 2019, 02:58 AM
Post#4



Posts: 2
Joined: 25-October 14



Worked for me.
Thank you.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th June 2019 - 04:25 PM