With VisualStudio
it is easy to create application types for Console, Forms, etc, but I see no option for a command line application. I intend to install the small program below as a simple .exe in c:\windows\system32. If I open a command terminal and CD to the bin\debug dir of the VS project, I can type DateTime and get nice output. However, if I copy the DateTime.exe to c:\windows\system32 and open another command terminal, the command DateTime gives an error saying that the application could not be started, because of .Net Shim errors.
Should I do something different to create a commandline application rather than a Console app?
Should I install more files from the bin\debug directory in c:\windows\system32 ?
using System;
namespace DateTime
{
class Program
{
static void Main()
{
Console.Write(System.DateTime.Now.ToString("o"));
}
}
}
NB: reason for the above command line app is that the system commands Date/T
and Time/T
do not provide seconds output. My app shows e.g. 2015-07-13T10:58:29.7329261+02:00 (, and you can get other formats with an argument, see previous edits of this question)