Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    North Dakota, USA
    Posts
    184
    Thanks
    0
    Thanked 0 Times in 0 Posts

    run dos commands from Access? (2003 sp1)

    This is probably a really simple question, but I haven't had to do this yet.

    I need to run this dos command:

    echo go>C:textfile.txt

    I'd like to run via VBA code in my Access app. I think I can run it calling the BAT file it is in using the Shell command (found example on Dev Ashish's website )

    But I'd like to avoid the bat file all together. Is this possible, if so how?

    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: run dos commands from Access? (2003 sp1)

    You can use Shell as follows:

    Shell "cmd /c echo go>C:textfile.txt"

    cmd starts the command line processor, the /c switch indicates that it should quit after processing the command.

  3. #3
    2 Star Lounger
    Join Date
    Jul 2002
    Location
    North Dakota, USA
    Posts
    184
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: run dos commands from Access? (2003 sp1)

    That worked. Thanks.

Posting Permissions

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