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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using Access to run a DOS utility 2

Status
Not open for further replies.

TommyTea

Programmer
Nov 7, 2002
43
US
Can anyone help with some code examples for running a set of dos commands from within Access (XP). Is this the shell() function? I come up totally blank on Microsoft help.
 
Try something like this:
pid = Shell("cmd /c command1 & command2 & command3")
IF you want the console window remains open after completion simply replace /c by /k.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Ive tried this to run an application on a neighbouring computer however it sends the message...
"Invalid procedure call or argument".

This how it looks...

Function RunShell(strShellName As String) As Integer
On Error GoTo Err_RunShell

Dim RetVal

RetVal=Shell(strShellName, vbNormalFocus)

Exit_RunShell:
Exit Function

Err_RunShell:
MsgBox Err.Description
Resume Exit_RunShell

End Function

Then from a form I tried to run an application as follows.
From a button control on click...

=RunShell("\\Server\Exports Database\ShippersDbFile.mdb")

It failed to work!, Could you advice on this. Please.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top