I\'ve recently learned that I can control the size of the CMD window running my program with mode x,y
. However I just as recently noticed that this sets the
here another variant:
/*
@echo off & mode 100,50
set "cscfile="
set Pathfile="%WinDir%\Microsoft.NET\Framework\csc.exe"
for /f "delims=" %%a in ('dir /b /a-d /s %PathFile%') do set "cscfile=%%a"
if defined cscfile (
%cscfile% /nologo /out:"%~0.exe" %0
) else exit /b
"%~0.exe"
del "%~0.exe"
cmd /k
*/
using System;
class Program
{
static void Main()
{
Console.SetBufferSize(100, 9999);
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Current Logged UserName: " + Environment.UserName);
Console.ResetColor();
Console.WriteLine("[Enter] to continue");
Console.ReadLine();
}
}