Results 1 to 7 of 7

Thread: shelled Dos programs windows stay open

  1. #1
    Guest
    After i shell a dos program, the window for it in windows 98 stays around. Its the one that tells you the dos program has terminated, but you have to close it manually. Is there any way around this? I tried it hiden but they are still there you just cant see them.

    any thought on how to get rid of these things?
    thanks

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    I seem to recall having to either:
    a) setting dos apps to close on exit in the OS
    and /or
    b) opening some apps with batchfiles and exiting them with an exit command

    Sorry, I can't quite recall

    paul

  3. #3
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Here try one of this. I don't remeber if the "C" or the "K" that auto close the dos.

    Code:
    '  Dummy = Shell("cmd.exe /C " & """C:\Macro.doc""", 1)
    '  Dummy = Shell("cmd.exe /K cd..", 1)
    Chemically Formulated As:
    Dr. Nitro

  4. #4
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    It's a "C" - and for Win'95 you'll have to use command.com instead of cmd.exe - eg;.

    Win-NT: Shell("cmd.exe /C [filename]")
    Win-95: Shell("command.com /C [filename]")

    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  5. #5
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330
    Hi,
    Alternatively, find the dos program through Windows explorer, right click on the program, select properties, then program, and check the "Close on Exit" box.
    The program will now close if shelled from VB or run manually.
    Al.
    A computer is a tool, not a toy.

  6. #6
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Thanks Buzby!

    Never new that. No wonder when I used cmd.exe on win95, it fails.
    Chemically Formulated As:
    Dr. Nitro

  7. #7
    Guest
    Win-95: Shell("command.com /C [filename]")

    it worked beautifully i thank you buzby.

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