Results 1 to 4 of 4

Thread: How to send text commands to DOS command prompt?

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    48

    Question How to send text commands to DOS command prompt?

    Hi all, I'm trying to be able to send a command on the dos command prompt, is it possible?

    I can open the DOS window with API, I know how to do that, but I don't know how to send a command such as "dir" or "ver" or "cd" to the prompt by using API.

    Is this process possible? Thanks a lot in advance.

  2. #2
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    I think it is best to create a textfile with the extension bat containing the commands you wish to execute then shell the bat file.

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    48
    Yup. That's what I ended up doing for now. But if anyone can find out how to do that, that would be cool. Thanks!

  4. #4
    New Member
    Join Date
    May 2001
    Location
    Calle
    Posts
    9

    Talking

    try this

    test="DIR > c:\dir.txt"
    Open "c:\dos.bat" For Append As #1
    Print #1, test
    Close #1
    Shell "c:\dos.bat", vbMinimizedNoFocus

    check your drive c: and look for dir.txt

Posting Permissions

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



Click Here to Expand Forum to Full Width