views:

1329

answers:

3

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?

+4  A: 

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.

Andrew Hare
A: 

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

Fabian Vilers
+2  A: 

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.

dr. evil