Results 1 to 6 of 6

Thread: DOS batch files

  1. #1
    Join Date
    Apr 2002
    Location
    Illinois
    Posts
    133

    Unanswered: DOS batch files

    Is there a way to run a DOS batch file (file.bat) from Access? I have tried the Shell command with no success.

    Thanks.
    SteveH

  2. #2
    Join Date
    Nov 2002
    Location
    Hillsboro, OR, USA
    Posts
    59

    Re: DOS batch files

    This has worked for me before:

    Code:
    Dim dblRunShell As Double
    Dim strBat, strFileName As String
    
       strFileName = me.cboFiles
       strBat = "..\download.bat " & strFileName
    
       dblRunShell = Shell(strBat, 1)

  3. #3
    Join Date
    Apr 2002
    Location
    Illinois
    Posts
    133

    me.cboFiles

    Bri,

    Thanks for the reply. I don't understand what me.cboFiles is.
    SteveH

  4. #4
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251
    I'd recommend to use Windows Scripting Host .... it has more features...

    RunThis = "MyProgram.exe"

    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run RunThis, 3, False


    see http://msdn.microsoft.com/library/de...l/wsmthrun.asp for details


    jiri

  5. #5
    Join Date
    Nov 2002
    Location
    Hillsboro, OR, USA
    Posts
    59

    Re: DOS batch files

    me.cboFiles would be the value from a combobox. Not needed, it just shows you how I used it. A stripped down version would look like this:

    Code:
    Dim dblRunShell As Double
    
       dblRunShell = Shell("..\download.bat ", 1)

  6. #6
    Join Date
    Apr 2002
    Location
    Illinois
    Posts
    133
    Brian and Jiri--thanks for the help. The problem is solved
    SteveH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •