Results 1 to 6 of 6

Thread: VB6 talk to DOS EXE

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Plainfield, Il
    Posts
    3

    Question

    I have a problem talking to a dos shell exe.

    I can open the program but I can not operate the program from a VB6 program I am making. The dos run program uses the alt key then a letter to go through the menu. Everywhere that I go to find code to write no one has a clue.

    The Dos program has to run and be available while so the vb program can control it.

    Has anyone ever Come across this problem before?


  2. #2
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    ??

    you can use sendkeys

    Code:
    SendKeys "keys",1
    or if it's an execute or a batch file that need parameters,
    put your param. in the shell.

    ex:
    shell "batch.bat parameters",1



  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Plainfield, Il
    Posts
    3

    Angry

    I tried using sendkey and it will not talk to the dos run program even after making the dos program AppActivate.

    I've tried many different ways nothing seems to work.

    I need the dos run program to run along with my vb program and having the ability to talk at any time to the dos program.

  4. #4
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    Try this for me:

    shell "cmd.exe dir /p",1

    I'm not sure but it will probably work.

  5. #5
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    cmd.exe = NT/2000
    command.com = 9X/ME
    -
    Just a tip

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Plainfield, Il
    Posts
    3

    Unhappy

    ok,
    i have the dos window open and was able to open an exe in the dos but am unable to send ex. (alt x) to the exe usually i just see a grey square show and nothing happens.
    I'm running on NT

    here is a sample of code

    DoEvents
    Call Shell("cmd.exe dir /p", 1)'tasklink2
    Call Sleep (2000)
    DoEvents
    Clipboard.Clear
    Clipboard.SetText ("tl a" & Chr$(13))'tasklink3
    AppActivate TaskLink2
    SendKeys "% ep", 1

    Call Sleep(2000)
    DoEvents
    Clipboard.Clear
    Clipboard.SetText ((Chr$(0) & Chr$(45)) & Chr$(13)) 'Alt-x & Return
    AppActivate TaskLink3
    SendKeys "% ep", 3




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