CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2001
    Location
    Akron, OH
    Posts
    2

    SHELL command question

    When the shell command executes, the DOS window pops up, command executes, then DOS window closes before I can read what was in it. How can I leave the DOS window open until I close it with ctrl+c or other?


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: SHELL command question

    try this: make a .bat file which includes only the call to your dos program. Then shell to the .bat file
    Hope this help

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: SHELL command question

    Right click on DOS program, go to properties and uncheck 'Close Window on exit'

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  4. #4
    Join Date
    Mar 2001
    Location
    Akron, OH
    Posts
    2

    Re: SHELL command question

    I am not running from a DOS icon or shortcut. The DOS app launches within my VB app so I can't set the checkbox.


  5. #5
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: SHELL command question

    DOes not matter. Find this DOS command and set the property.

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  6. #6
    Join Date
    Mar 2001
    Posts
    1

    Re: SHELL command question

    The following opens a new DOS window and issues the DIR command.
    The window gets the focus, and you can close it when you wish.

    Shell "c:\windows\command.com /K dir", vbNormalFocus


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

Featured