compie
compie

Reputation: 10536

Prevent command prompt from closing automatically (CS Script)

I'm experimenting with CS-Script and my problem is that each time I run a script the console window is automatically closed when the script exits. How can I prevent this from happening?

Upvotes: 3

Views: 7132

Answers (3)

dr. evil
dr. evil

Reputation: 27265

I don't how you call it but you can always call it with "Ctrl + R" > cmd.exe /k [your command] or Console.ReadLine() in your script.

Upvotes: 3

Fabian Vilers
Fabian Vilers

Reputation: 2982

A poor way concists of adding a Console.Read() at the end of you script.

Upvotes: 0

Andrew Hare
Andrew Hare

Reputation: 351516

If you don't want to change the script itself then open a command window and execute the script from the command line. The only reason the console closes after the script completes is because it was created by the script itself. The script will not close a console that you opened.

Upvotes: 7

Related Questions