[AccessD] A2K:OT: Get a batch file to quit or close

Stuart McLachlan stuart at lexacorp.com.pg
Thu Aug 28 22:22:08 CDT 2003


On 28 Aug 2003 at 19:51, Drew Wutka wrote:

> The problem is that the batch file 'called' the app.  It isn't going to
> close, until the app closes.  A simple way around this would be to have a
> little VB .exe Shell out to the app, then close.  Then have your batch file
> call your VB.exe, since it closes once it's run the shell command,
> everything should close right away.
> 
> Then again, if you are shelling out with VB, why would you need a batch
> file! <grin>
> 

Because the batch file does other things as well?
People like Darren aren't like you me - we enjoy knocking up a new 
compiled app for this or that :-)

But that is actually a good idea of yours. A simple Shell app that 
you can put in a batch file so that the batch can be closed while the 
final called app is still running ( or just to do other things 
asynchronously in a batch file).

Wait a minute......

Ok, I'm back.

You can download it as http://www.lexacorp.com.pg/soft/Shell.zip
Its' a 5KB zip file containing the program Shell.exe.  

Here's the complete PB/Win Source for the application:

/*Contents of file Shell.Bas

FUNCTION PBMAIN AS LONG
    LOCAL strMessage AS STRING
    IF COMMAND$ > "" THEN
        FUNCTION = SHELL(COMMAND$)
    ELSE
        strMessage =  _
          "Run commands in a batch file asynchronously. " & 
CHR$(13,10,13,10) _
          & "Usage: SHELL commandline" & CHR$(13,10,13,10) _
          & "Another free utility from Lexacorp" & CHR$(13,10) _
          & "http://www.lexacorp.com.pg"
            
        MSGBOX strMessage,,"Shell.Exe"
    END IF
END FUNCTION

End of file Shell.Bas */

 
-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System 
Support.





More information about the AccessD mailing list