Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Posts
    333

    Unanswered: Command line from A2K

    I want to open a command window, change the directory and issue a command from VBA. I'm trying to use the shell function but I cannot get it to accept any arguments. Can anyone point out my mistake?
    Code:
    Shell "cmd.exe -s:" & "cd..  myFunc<infile>outfile", vbNormalFocus

  2. #2
    Join Date
    Feb 2005
    Posts
    333
    Here's how to do it. i guess that it was more of a scripting question than an Access question.
    Code:
        Dim oShell as Object
    
        Set oShell = CreateObject("WScript.Shell")
        oShell.Run "cmd.exe /K cd c:\\myDir &myFunc<infile>outfile", 0
        Set oShell = Nothing
    I haven't used this site for some time so maybe I missed something. What happened to the advanced search option? I can now only do a generic search.

Posting Permissions

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