Is there a way in Windows to launch a .csx script directly (e.g. by double clicking the file, or from the start menu, or via an app launcher like Launchy) such that the script runs in the background without opening a command line window?
For example, say I have a simple "lowercase.csx" script which simply takes whatever text is in my clipboard, converts it to lowercase, and puts the result back in my clipboard. I want to be able to double click on that .csx file and have that run completely in the background without opening any kind of window.
Currently both ScriptCS.exe and the new csi.exe launcher that comes with VS2015 Update 1 will open a console window when running a .csx file, even if that file doesn't output anything to the console.
Note: I know that a new window isn't opened if you launch a script from a console window. What I want to to launch a script in a non-command line context and have it open no windows.
Note2: The equivalent of what I want in "CS-Script" (a ScriptCS alternative) is to launch the files using "csws.exe".
You can make your own version of csi.exe
that runs without a console.
Simply create a new project, make sure the Type is set to WinForms instead of Console, then add the C# Scripting package from NuGet and copy-paste the csi.exe source code.
scriptcs does not support this. However there is an application that solves this problem: https://gitlab.com/Lions-Open-Source/ScriptCSW
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With