[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

keep the shell window open

Posted on 2005-05-16
2
Medium Priority
?
1,052 Views
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?

0
Comment
Question by:brokeMyLegBiking
2 Comments
 
LVL 8

Expert Comment

by:bman9111
ID: 14014775
process.start(then program)

ex

process.start("C:\test.exe")


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 vb.net way
0
 
LVL 4

Accepted Solution

by:
gopinathdeepak earned 2000 total points
ID: 14016140
yeah...

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

i.e.
instead of saying something like..

ping 192.168.101.1 -n 1

run it as

cmd.exe /K ping 192.168.101.1 -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
        ps.Start()
        ps.WaitForExit()
        ps.Close()
'==============================

good luck!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

834 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