So I'm new to C# and programming and just wrote my first C# script. So now how do I run it? Do I just save it as a .bat file and run it that way? Ultimately, I want to schedule this to run via windows task scheduler.
Asked
Active
Viewed 2,300 times
1
-
4C# script? As far as I know, there are no C# interpreters - you need to compile your program into an executable. How have you written your C#? What IDE are you using? – Oded Apr 11 '13 at 13:29
-
1What's the output type of the assembly you created? DLL or EXE? – Mike Perrenoud Apr 11 '13 at 13:29
-
1I wrote it in Visual Studio Console Application...sorry for the wrong lingo... – lightweight Apr 11 '13 at 13:31
-
What file extension is your output? – Ryan Gates Apr 11 '13 at 13:33
-
1Then build your application and find the compiled *.exe in the "Debug/Release" directory. – Rikki B Apr 11 '13 at 13:33
-
found it but it opens up as an XML config file – lightweight Apr 11 '13 at 13:36
-
There are several files. There is a `.config` file with the name of the program, and also a `.exe` - that's the executable. – Oded Apr 11 '13 at 13:39
2 Answers
1
You mean a C# program, not script, right? Just use a console application project, and call it (the executable) from scheduler.

L-Four
- 13,345
- 9
- 65
- 109
0
If you prefer combining C# with script languages, here are some options:
- Powershell: How to run PowerShell scripts from C#
- Lua: Lua Wrapper for C#?
- IronPython: Embedding IronPython in a C# Application