// 2>nul&@echo off&cls&goto batch
/*
:batch
for /f "tokens=3,*" %%F in ('reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /v InstallPath') do set "InstallPath=%%F"
if exist "%InstallPath%csc.exe" ("%InstallPath%csc.exe" /out:"%~dp0\invis.exe" /target:winexe "%~dpnx0") else (echo ERROR - Missing csc.exe)
pause&exit
*/
using System;
using System.Diagnostics;
class Program
{
static void Main(string[] args)
{
if (args.Length == 0)
{
return;
}
using (Process process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = args[0],
Arguments = string.Join(" ", args, 1, args.Length - 1),
WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true,
UseShellExecute = false
}
})
{
process.Start();
// process.WaitForExit(); // Blocks execution until the process finishes
}
}
}