keep the shell window open

Posted on 2005-05-16
Last Modified: 2008-03-17

I have a VB.NET program that kicks of a shell. How do I get the shell to not close immediately when it is done?

Should I use something with more options than the Shell command, like ProcessStartInfo, or do I just need to pass in a readline operation with the shell command so that it waits for me to press enter before closing?

Question by:brokeMyLegBiking
    LVL 8

    Expert Comment

    process.start(then program)



    not sure if this was what u are looking for.  the shell command is really for the vb6. Still can use it by process is the way
    LVL 4

    Accepted Solution


    say u want to run the ping command in the shell ..... use the cmd.exe command ahead of the ping command...

    instead of saying something like..

    ping -n 1

    run it as

    cmd.exe /K ping -n 1...

    (the option parameter /K for cmd.exe runs the ping command but keeps the shell open.../C makes it close, but it also the default option i think...)

    heres a demonstration using the Process Class...

           Dim ps As New Process
            With ps.StartInfo
                .FileName = "cmd.exe"
                .Arguments = "/K ping deepak -n 1"
                .CreateNoWindow = False
            End With

    good luck!

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now