Results 1 to 10 of 10

Thread: bat file

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    when I run a .bat file it does it's thing
    and then sits in the systray...how do I close
    down the dos window when the bat file is finised..
    id..
    do this
    do that
    DoEvents
    ....what goes here
    unload me
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Try Exit.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  3. #3
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    As the last line of the batch file, anyway.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  4. #4

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    sorry...

    no cigar....does nothing
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Use Sendmessage api and send WM_Destroy to the command prompt window. Also there's a tip on it somewhere you may search for it
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    If you are shelling the batch file through with codes, try the following:

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

    The "/C" will terminate the dos window after it runs the batch file.
    Chemically Formulated As:
    Dr. Nitro

  7. #7

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    thanks all...

    just found it...Nito:
    the Environ("COMSPEC")function is suggested as it
    will find the command com regardless of where it is
    on a pc..ie..under D: or E: or whatever.
    Thanks all .

    Dim h As Long
    h = Shell(Environ("COMSPEC") & " /C C:\Cleaner.bat")
    DoEvents




    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  8. #8
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633

    Smile That is new!

    That is great!

    Do you mean that Environ("COMSPEC") is equivalent to cmd.exe or command.com?

    Is "COMSPEC" a constant for Environ?
    Chemically Formulated As:
    Dr. Nitro

  9. #9
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    By the way, how did you get the envstrings like COMSPEC?
    Chemically Formulated As:
    Dr. Nitro

  10. #10

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    ...

    Nitro...it's command.com
    it's from MS Help...

    http://support.microsoft.com/support.../q161/3/03.asp

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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