• run dos commands from Access? (2003 sp1)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » run dos commands from Access? (2003 sp1)

    Author
    Topic
    #424328

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #974133

      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.

    Viewing 0 reply threads
    Reply To: Reply #974577 in run dos commands from Access? (2003 sp1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel