Re: How to Run Batch File from Access
From: Irshad Alam (IrshadAlam_at_discussions.microsoft.com)
Date: 12/13/04
- Next message: Irshad Alam: "Re: How to prevent Access from Closing"
- Previous message: DebbieG: "Re: All records are locked"
- In reply to: kiwibruce: "Re: How to Run Batch File from Access"
- Next in thread: Panteliadis Babis: "Re: How to Run Batch File from Access"
- Reply: Panteliadis Babis: "Re: How to Run Batch File from Access"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 13 Dec 2004 02:29:01 -0800
I have Checked again as below as your advised , but still it gives error :
Function RunBatch()
RunBatch = call Shell(Environ$("COMSPEC") & "/C C:\TEST1.BAT", vbNormalFocus)
End Function
Please advise any other sulution.
Irshad.
"kiwibruce" wrote:
> Hi
> I think your code should read
> RunBatch = call Shell(Environ$("COMSPEC") & "/c c:\GetFile.BAT",
> vbNormalFocus)
>
> Not
>
> RunBatch = call Shell(Environ$("COMSPEC") & "/C GetFile", vbNormalFocus)
> You must fully qualify the path and extension
> See the Dev's (One of the Access Gods) site
> http://www.mvps.org/access/general/gen0015.htm for reference
>
> Regards
>
> Bruce
>
> "Irshad Alam" <IrshadAlam@discussions.microsoft.com> wrote in message
> news:D1B6A1C3-06CC-4C68-8141-3B868D86A269@microsoft.com...
> >I want to Run a Dos Batch File from Microsoft Access Form Command Button.
> >
> > I tried the following code, but failed :
> > Function RunBatch()
> > Dim GetFile As String
> > GetFile = Me!Text2
> > 'In the text2 field of the form, I will write the complete batch file path
> > RunBatch = call Shell(Environ$("COMSPEC") & "/C GetFile", vbNormalFocus)
> > End Function
> >
> > I called that Function on Command Button and it fails, does not work,
> > gives
> > error.
> >
> > Please advise, what will be writing Code.
> >
>
>
>
- Next message: Irshad Alam: "Re: How to prevent Access from Closing"
- Previous message: DebbieG: "Re: All records are locked"
- In reply to: kiwibruce: "Re: How to Run Batch File from Access"
- Next in thread: Panteliadis Babis: "Re: How to Run Batch File from Access"
- Reply: Panteliadis Babis: "Re: How to Run Batch File from Access"
- Messages sorted by: [ date ] [ thread ]