Repository: stbrenner/SilentCMD
Branch: master
Commit: 2541b13f8372
Files: 22
Total size: 49.1 KB
Directory structure:
gitextract_5t7vmtsf/
├── .gitignore
├── Brenner.SilentCmd/
│ ├── ArgumentParser.cs
│ ├── Brenner.SilentCmd.csproj
│ ├── Configuration.cs
│ ├── Engine.cs
│ ├── LogWriter.cs
│ ├── Program.cs
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── app.config
├── Brenner.SilentCmd.Tests/
│ ├── Brenner.SilentCmd.Tests.csproj
│ ├── ConfigurationTest.cs
│ ├── Dummy.cmd
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ ├── TestDelay.cmd
│ └── packages.config
├── LICENSE
├── README.md
└── SilentCmd.sln
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.vs
bin
obj
Debug
Release
*.DotSettings
*.user
*.suo
packages
================================================
FILE: Brenner.SilentCmd/ArgumentParser.cs
================================================
using System.Globalization;
namespace Brenner.SilentCmd
{
public static class ArgumentParser
{
public static bool IsName(string arg, string name)
{
return arg.StartsWith(name, true, CultureInfo.InvariantCulture) &&
(name.Length == arg.Length || arg[name.Length] == ':');
}
public static bool TryGetValue(string arg, string name, out string value)
{
if (IsName(arg, name))
{
int startPosition = name.Length + 1; // +1 because of colon separator
value = arg.Substring(startPosition).Trim('"');
return true;
}
value = null;
return false;
}
}
}
================================================
FILE: Brenner.SilentCmd/Brenner.SilentCmd.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{461E6475-6450-40ED-B68C-7F012701E6C6}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Brenner.SilentCmd</RootNamespace>
<AssemblyName>SilentCMD</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.5.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisLogFile>bin\Debug\SilentCMD.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisLogFile>bin\Release\SilentCMD.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ArgumentParser.cs" />
<Compile Include="Configuration.cs" />
<Compile Include="Engine.cs" />
<Compile Include="LogWriter.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
================================================
FILE: Brenner.SilentCmd/Configuration.cs
================================================
using Brenner.SilentCmd.Properties;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
namespace Brenner.SilentCmd
{
public class Configuration
{
public bool LogAppend { get; private set; }
public string LogFilePath { get; private set; }
public long MaxLogSize { get; private set; }
public string BatchFilePath { get; set; }
public string BatchFileArguments { get; private set; }
public TimeSpan Delay { get; private set; }
public bool ShowHelp { get; private set; }
public Configuration()
{
LogAppend = Settings.Default.DefaultLogAppend;
LogFilePath = Settings.Default.DefaultLogFilePath;
MaxLogSize = Settings.Default.DefaultLogSize;
BatchFilePath = Settings.Default.DefaultBatchFilePath;
BatchFileArguments = Settings.Default.DefaultBatchFileArguments;
Delay = Settings.Default.DefaultDelay;
}
public void ParseArguments(IEnumerable<string> args)
{
var argumentsBuilder = new StringBuilder();
var batchFilePathWasRead = false;
string argValue;
foreach (string arg in args)
{
if (ArgumentParser.TryGetValue(arg, "/LOG+", out argValue))
{
LogAppend = true;
LogFilePath = argValue;
continue;
}
if (ArgumentParser.TryGetValue(arg, "/LOG", out argValue))
{
LogAppend = false;
LogFilePath = argValue;
continue;
}
if (ArgumentParser.TryGetValue(arg, "/LOGSIZE", out argValue))
{
MaxLogSize = Convert.ToInt64(argValue);
continue;
}
if (ArgumentParser.TryGetValue(arg, "/DELAY", out argValue))
{
Delay = TimeSpan.FromSeconds(Convert.ToDouble(argValue));
continue;
}
if (ArgumentParser.IsName(arg, "/?"))
{
ShowHelp = true;
}
if (!batchFilePathWasRead)
{
BatchFilePath = arg;
batchFilePathWasRead = true;
continue;
}
if (arg.Contains(" "))
{
argumentsBuilder.AppendFormat("\"{0}\" ", arg);
continue;
}
argumentsBuilder.AppendFormat("{0} ", arg);
}
if (argumentsBuilder.Length > 0)
{
BatchFileArguments = argumentsBuilder.ToString();
}
}
}
}
================================================
FILE: Brenner.SilentCmd/Engine.cs
================================================
using System;
using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;
using Brenner.SilentCmd.Properties;
using System.IO;
using System.Linq;
using System.Threading;
namespace Brenner.SilentCmd
{
internal class Engine
{
private Configuration _config = new Configuration();
private readonly LogWriter _logWriter = new LogWriter();
/// <summary>
/// Executes the batch file defined in the arguments
/// </summary>
public int Execute(string[] args)
{
try
{
_config.ParseArguments(args);
_logWriter.Initialize(_config.LogFilePath, _config.LogAppend, _config.MaxLogSize);
if (_config.ShowHelp)
{
ShowHelp();
return 0;
}
DelayIfNecessary();
ResolveBatchFilePath();
using (var process = new Process())
{
process.StartInfo = new ProcessStartInfo(_config.BatchFilePath, _config.BatchFileArguments)
{
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false, // CreateNoWindow only works, if shell is not used
CreateNoWindow = true
};
process.OutputDataReceived += OutputHandler;
process.ErrorDataReceived += OutputHandler;
process.Start();
_logWriter.WriteLine(Resources.StartingCommand, _config.BatchFilePath, process.Id);
process.BeginOutputReadLine();
process.WaitForExit();
return process.ExitCode;
}
}
catch (Exception e)
{
_logWriter.WriteLine(Resources.Error, e.Message);
return 1;
}
finally
{
_logWriter.WriteLine(Resources.FinishedCommand, _config.BatchFilePath);
_logWriter.Dispose();
}
}
private void DelayIfNecessary()
{
if (_config.Delay <= TimeSpan.FromSeconds(0)) return;
_logWriter.WriteLine(Resources.Delay, _config.Delay.TotalSeconds);
Thread.Sleep(_config.Delay);
}
private static void ShowHelp()
{
Assembly assembly = Assembly.GetExecutingAssembly();
AssemblyName name = assembly.GetName();
string userManual = string.Format(Resources.UserManual, name.Version);
MessageBox.Show(userManual, Resources.ProgramTitle);
}
private void ResolveBatchFilePath()
{
if (string.IsNullOrEmpty(_config.BatchFilePath)) return;
if (!string.IsNullOrEmpty(Path.GetDirectoryName(_config.BatchFilePath))) return;
if (string.IsNullOrEmpty(Path.GetExtension(_config.BatchFilePath)))
{
if (FindPath(_config.BatchFilePath + ".bat")) return;
FindPath(_config.BatchFilePath + ".cmd");
}
else
{
FindPath(_config.BatchFilePath);
}
}
/// <returns>True if file was found</returns>
private bool FindPath(string filename)
{
string currentPath = Path.Combine(Environment.CurrentDirectory, filename);
if (File.Exists(currentPath)) return true;
var enviromentPath = System.Environment.GetEnvironmentVariable("PATH");
var paths = enviromentPath.Split(';');
var fullPath = paths.Select(x => Path.Combine(x, filename))
.Where(x => File.Exists(x))
.FirstOrDefault();
if (!string.IsNullOrEmpty(fullPath))
{
_config.BatchFilePath = fullPath;
return true;
}
return false;
}
private void OutputHandler(object sender, DataReceivedEventArgs e)
{
_logWriter.WriteLine(e.Data);
}
}
}
================================================
FILE: Brenner.SilentCmd/LogWriter.cs
================================================
using System;
using System.Diagnostics;
using System.IO;
namespace Brenner.SilentCmd
{
internal class LogWriter : IDisposable
{
private string _fullPath;
private StreamWriter _writer;
private long _maxSize;
private bool _append;
public bool Initialized { get { return _writer != null; } }
/// <summary>
/// Initializies a log writer that logs to the specified path.
/// </summary>
/// <param name="logPath">Path to the destination log file.</param>
/// <param name="append">True if entrie should be added to an existing log file</param>
public void Initialize(string logPath = null, bool append = false, long maxSize = 0)
{
try
{
if (string.IsNullOrEmpty(logPath)) return; // No logging if no path specified
_fullPath = Environment.ExpandEnvironmentVariables(logPath);
_append = append;
_maxSize = maxSize;
if (_writer != null) _writer.Dispose();
_writer = new StreamWriter(_fullPath, _append);
}
catch (Exception e)
{
Trace.WriteLine(e);
}
}
private void RotateLogFile()
{
try
{
if (_maxSize <= 0) return; // Ignore if no max size specified
if (_writer != null && _writer.BaseStream != null && _writer.BaseStream.Length > _maxSize)
{
_writer.Dispose();
File.Copy(_fullPath, _fullPath + ".old", true);
File.Delete(_fullPath);
_writer = new StreamWriter(_fullPath, _append);
}
}
catch (Exception e)
{
Trace.WriteLine(e);
}
}
public void Dispose()
{
try
{
if (_writer != null)
{
_writer.Dispose();
}
}
catch (Exception e)
{
Trace.WriteLine(e);
}
GC.SuppressFinalize(this);
}
public void WriteLine(string format, params object[] args)
{
try
{
RotateLogFile();
if (_writer != null && format != null)
{
string message = string.Format(format, args);
string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
_writer.WriteLine("{0} - {1}", timestamp, message);
}
}
catch (Exception e)
{
Trace.WriteLine(e);
}
}
}
}
================================================
FILE: Brenner.SilentCmd/Program.cs
================================================
using System;
namespace Brenner.SilentCmd
{
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static int Main(string[] args)
{
var engine = new Engine();
return engine.Execute(args);
}
}
}
================================================
FILE: Brenner.SilentCmd/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SilentCMD")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Stephan Brenner")]
[assembly: AssemblyProduct("SilentCMD")]
[assembly: AssemblyCopyright("Copyright © 2011-2025 Stephan Brenner")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("57e768d9-0964-47e5-ad1c-201a6b296cb2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.0.0")]
[assembly: AssemblyFileVersion("1.5.0.0")]
================================================
FILE: Brenner.SilentCmd/Properties/Resources.Designer.cs
================================================
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Brenner.SilentCmd.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Brenner.SilentCmd.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Delaying execution by {0} seconds.
/// </summary>
internal static string Delay {
get {
return ResourceManager.GetString("Delay", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error: {0}.
/// </summary>
internal static string Error {
get {
return ResourceManager.GetString("Error", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Finished "{0}".
/// </summary>
internal static string FinishedCommand {
get {
return ResourceManager.GetString("FinishedCommand", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to SilentCMD.
/// </summary>
internal static string ProgramTitle {
get {
return ResourceManager.GetString("ProgramTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Started "{0}" (PID {1}).
/// </summary>
internal static string StartingCommand {
get {
return ResourceManager.GetString("StartingCommand", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to SilentCMD [Options] BatchFile [BatchArguments]
///
///Options:
////? :: Show help
////LOG:file :: Output status to log file (overwrite existing log).
////LOG+:file :: Output status to log file (append to existing log).
////LOGSIZE:bytes :: Maximum log file size after which it is truncated
////DELAY:seconds :: Delay the execution of batch file by x seconds
///
///Examples
///SilentCMD c:\DoSomething.bat
///SilentCMD /LOG:c:\MyLog.txt c:\MyBatch.cmd MyParam1
///SilentCMD /LOG+:c:\MyLog.txt /LOGSIZE:1000000 c:\MyBatch.cmd
///SilentCMD [rest of string was truncated]";.
/// </summary>
internal static string UserManual {
get {
return ResourceManager.GetString("UserManual", resourceCulture);
}
}
}
}
================================================
FILE: Brenner.SilentCmd/Properties/Resources.resx
================================================
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="UserManual" xml:space="preserve">
<value>SilentCMD [Options] BatchFile [BatchArguments]
Options:
/? :: Show help
/LOG:file :: Output status to log file (overwrite existing log).
/LOG+:file :: Output status to log file (append to existing log).
/LOGSIZE:bytes :: Maximum log file size after which it is truncated
/DELAY:seconds :: Delay the execution of batch file by x seconds
Examples
SilentCMD c:\DoSomething.bat
SilentCMD /LOG:c:\MyLog.txt c:\MyBatch.cmd MyParam1
SilentCMD /LOG+:c:\MyLog.txt /LOGSIZE:1000000 c:\MyBatch.cmd
SilentCMD /DELAY:3600 c:\MyBatch.cmd
Version {0}
Free software under MIT license
More information on https://www.stephan-brenner.com</value>
</data>
<data name="ProgramTitle" xml:space="preserve">
<value>SilentCMD</value>
</data>
<data name="Error" xml:space="preserve">
<value>Error: {0}</value>
</data>
<data name="StartingCommand" xml:space="preserve">
<value>Started "{0}" (PID {1})</value>
</data>
<data name="FinishedCommand" xml:space="preserve">
<value>Finished "{0}"</value>
</data>
<data name="Delay" xml:space="preserve">
<value>Delaying execution by {0} seconds</value>
</data>
</root>
================================================
FILE: Brenner.SilentCmd/Properties/Settings.Designer.cs
================================================
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Brenner.SilentCmd.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string DefaultBatchFilePath {
get {
return ((string)(this["DefaultBatchFilePath"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string DefaultBatchFileArguments {
get {
return ((string)(this["DefaultBatchFileArguments"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("%temp%\\SilentCMD.log")]
public string DefaultLogFilePath {
get {
return ((string)(this["DefaultLogFilePath"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool DefaultLogAppend {
get {
return ((bool)(this["DefaultLogAppend"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("00:00:00")]
public global::System.TimeSpan DefaultDelay {
get {
return ((global::System.TimeSpan)(this["DefaultDelay"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public long DefaultLogSize {
get {
return ((long)(this["DefaultLogSize"]));
}
}
}
}
================================================
FILE: Brenner.SilentCmd/Properties/Settings.settings
================================================
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Brenner.SilentCmd.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="DefaultBatchFilePath" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="DefaultBatchFileArguments" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="DefaultLogFilePath" Type="System.String" Scope="Application">
<Value Profile="(Default)">%temp%\SilentCMD.log</Value>
</Setting>
<Setting Name="DefaultLogAppend" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="DefaultDelay" Type="System.TimeSpan" Scope="Application">
<Value Profile="(Default)">00:00:00</Value>
</Setting>
<Setting Name="DefaultLogSize" Type="System.Int64" Scope="Application">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>
================================================
FILE: Brenner.SilentCmd/app.config
================================================
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Brenner.SilentCmd.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
<applicationSettings>
<Brenner.SilentCmd.Properties.Settings>
<setting name="DefaultBatchFilePath" serializeAs="String">
<value />
</setting>
<setting name="DefaultBatchFileArguments" serializeAs="String">
<value />
</setting>
<setting name="DefaultLogFilePath" serializeAs="String">
<value>%temp%\SilentCMD.log</value>
</setting>
<setting name="DefaultLogAppend" serializeAs="String">
<value>False</value>
</setting>
<setting name="DefaultDelay" serializeAs="String">
<value>00:00:00</value>
</setting>
<setting name="DefaultLogSize" serializeAs="String">
<value>0</value>
</setting>
</Brenner.SilentCmd.Properties.Settings>
</applicationSettings>
</configuration>
================================================
FILE: Brenner.SilentCmd.Tests/Brenner.SilentCmd.Tests.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A2A99298-3567-4D16-8FEF-1FD0DACA3178}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Brenner.SilentCmd.Tests</RootNamespace>
<AssemblyName>Brenner.SilentCmd.Tests</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll</HintPath>
</Reference>
<Reference Include="xunit.assert, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="xunit.core, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.core.2.4.1\lib\net452\xunit.core.dll</HintPath>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ConfigurationTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\xunit.analyzers.0.10.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Brenner.SilentCmd\Brenner.SilentCmd.csproj">
<Project>{461e6475-6450-40ed-b68c-7f012701e6c6}</Project>
<Name>Brenner.SilentCmd</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.props'))" />
<Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.targets'))" />
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
<Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" />
</Project>
================================================
FILE: Brenner.SilentCmd.Tests/ConfigurationTest.cs
================================================
using System;
using Xunit;
namespace Brenner.SilentCmd.Tests
{
public class ConfigurationTest
{
[Fact]
public void Log()
{
Configuration config = new Configuration();
config.ParseArguments(new string[] {@"/LOG:c:\temp\test.log"});
Assert.False(config.LogAppend);
Assert.Equal(@"c:\temp\test.log", config.LogFilePath);
}
[Fact]
public void NotLog()
{
Configuration config = new Configuration();
config.ParseArguments(new string[] { @"/LOGA:c:\temp\test.log" });
Assert.Null(config.LogFilePath);
}
[Fact]
public void LogPlus()
{
Configuration config = new Configuration();
config.ParseArguments(new string[] { "/LOG+:\"c:\\My Files\\test.log\"" });
Assert.True(config.LogAppend);
Assert.Equal(@"c:\My Files\test.log", config.LogFilePath);
}
[Fact]
public void Delay()
{
Configuration config = new Configuration();
config.ParseArguments(new string[] { "/DELAY:1234" });
Assert.Equal(TimeSpan.FromSeconds(1234), config.Delay);
}
[Fact]
public void Help()
{
Configuration config = new Configuration();
config.ParseArguments(new string[] { "/?" });
Assert.True(config.ShowHelp);
}
}
}
================================================
FILE: Brenner.SilentCmd.Tests/Dummy.cmd
================================================
@echo off
echo This is a test batch file for SilentCMD
echo Parameter 1: %1
echo Date: %date%
TIMEOUT /T 5
exit /B 1234
================================================
FILE: Brenner.SilentCmd.Tests/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Brenner.SilentCmd.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Avira Operations GmbH & Co. KG;")]
[assembly: AssemblyProduct("Brenner.SilentCmd.Tests")]
[assembly: AssemblyCopyright("Copyright © Avira Operations GmbH & Co. KG; 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a2a99298-3567-4d16-8fef-1fd0daca3178")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
================================================
FILE: Brenner.SilentCmd.Tests/TestDelay.cmd
================================================
@echo off
"%~dp0\..\Brenner.SilentCmd\bin\Debug\SilentCMD.exe" "%~dp0\Dummy.cmd" param /LOG:"%temp%\TestDelay.log" /DELAY:5
================================================
FILE: Brenner.SilentCmd.Tests/packages.config
================================================
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="xunit" version="2.4.1" targetFramework="net452" />
<package id="xunit.abstractions" version="2.0.3" targetFramework="net452" />
<package id="xunit.analyzers" version="0.10.0" targetFramework="net452" />
<package id="xunit.assert" version="2.4.1" targetFramework="net452" />
<package id="xunit.core" version="2.4.1" targetFramework="net452" />
<package id="xunit.extensibility.core" version="2.4.1" targetFramework="net452" />
<package id="xunit.extensibility.execution" version="2.4.1" targetFramework="net452" />
<package id="xunit.runner.visualstudio" version="2.4.1" targetFramework="net452" developmentDependency="true" />
</packages>
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2011 Stephan Brenner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# SilentCMD
SilentCMD executes a batch file without opening the command prompt window. If required, the console output can be redirected to a log file.
<table>
<tr><td>Download:</td><td><a href="https://github.com/ymx/SilentCMD/releases/download/v1.5/SilentCMD-1.5.zip"><strong>SilentCMD-1.5.zip</strong></a> (7 KB)</td></tr>
<tr><td>Operating System:</td><td>Windows 10 or newer</td></tr>
<tr><td>License:</td><td><a href="/LICENSE?raw=true">MIT</a></td></tr>
</table>
### Command Line Syntax
```
SilentCMD [Options] BatchFile [BatchArguments]
Options:
/? :: Show help
/LOG:file :: Output status to LOG file (overwrite existing log)
/LOG+:file :: Output status to LOG file (append to existing log)
/LOGSIZE:bytes :: Maximum log file size after which it is truncated
/DELAY:seconds :: Delay the execution of batch file by x seconds
```
#### Examples
```
SilentCMD c:\DoSomething.bat
SilentCMD /LOG:c:\MyLog.txt c:\MyBatch.cmd MyParam1
SilentCMD /LOG+:c:\MyLog.txt /LOGSIZE:1000000 c:\MyBatch.cmd
SilentCMD /DELAY:3600 c:\MyBatch.cmd
```
### Use Cases
You can use SilentCMD for running batch files from the Windows Task Scheduler. With the tool you do not get interrupted by the command prompt window that normally would pop up.
You can call SilentCMD without parameters if required (e.g. when double-clicking it in Windows Explorer). In that case you have to specify the default parameters in SilentCMD.exe.config.
```
<setting name="DefaultBatchFilePath" serializeAs="String">
<value>c:\temp\test.cmd</value>
</setting>
<setting name="DefaultBatchFileArguments" serializeAs="String">
<value>arg1 arg2=xyz</value>
</setting>
```
================================================
FILE: SilentCmd.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.168
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Brenner.SilentCmd", "Brenner.SilentCmd\Brenner.SilentCmd.csproj", "{461E6475-6450-40ED-B68C-7F012701E6C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Brenner.SilentCmd.Tests", "Brenner.SilentCmd.Tests\Brenner.SilentCmd.Tests.csproj", "{A2A99298-3567-4D16-8FEF-1FD0DACA3178}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{461E6475-6450-40ED-B68C-7F012701E6C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{461E6475-6450-40ED-B68C-7F012701E6C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{461E6475-6450-40ED-B68C-7F012701E6C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{461E6475-6450-40ED-B68C-7F012701E6C6}.Release|Any CPU.Build.0 = Release|Any CPU
{A2A99298-3567-4D16-8FEF-1FD0DACA3178}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2A99298-3567-4D16-8FEF-1FD0DACA3178}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2A99298-3567-4D16-8FEF-1FD0DACA3178}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2A99298-3567-4D16-8FEF-1FD0DACA3178}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6AE95268-5757-4AF5-B1FB-50DB017CF1DA}
EndGlobalSection
EndGlobal
gitextract_5t7vmtsf/ ├── .gitignore ├── Brenner.SilentCmd/ │ ├── ArgumentParser.cs │ ├── Brenner.SilentCmd.csproj │ ├── Configuration.cs │ ├── Engine.cs │ ├── LogWriter.cs │ ├── Program.cs │ ├── Properties/ │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ └── app.config ├── Brenner.SilentCmd.Tests/ │ ├── Brenner.SilentCmd.Tests.csproj │ ├── ConfigurationTest.cs │ ├── Dummy.cmd │ ├── Properties/ │ │ └── AssemblyInfo.cs │ ├── TestDelay.cmd │ └── packages.config ├── LICENSE ├── README.md └── SilentCmd.sln
SYMBOL INDEX (29 symbols across 8 files)
FILE: Brenner.SilentCmd.Tests/ConfigurationTest.cs
class ConfigurationTest (line 6) | public class ConfigurationTest
method Log (line 8) | [Fact]
method NotLog (line 17) | [Fact]
method LogPlus (line 25) | [Fact]
method Delay (line 34) | [Fact]
method Help (line 42) | [Fact]
FILE: Brenner.SilentCmd/ArgumentParser.cs
class ArgumentParser (line 5) | public static class ArgumentParser
method IsName (line 7) | public static bool IsName(string arg, string name)
method TryGetValue (line 13) | public static bool TryGetValue(string arg, string name, out string value)
FILE: Brenner.SilentCmd/Configuration.cs
class Configuration (line 9) | public class Configuration
method Configuration (line 19) | public Configuration()
method ParseArguments (line 29) | public void ParseArguments(IEnumerable<string> args)
FILE: Brenner.SilentCmd/Engine.cs
class Engine (line 12) | internal class Engine
method Execute (line 20) | public int Execute(string[] args)
method DelayIfNecessary (line 68) | private void DelayIfNecessary()
method ShowHelp (line 76) | private static void ShowHelp()
method ResolveBatchFilePath (line 84) | private void ResolveBatchFilePath()
method FindPath (line 102) | private bool FindPath(string filename)
method OutputHandler (line 123) | private void OutputHandler(object sender, DataReceivedEventArgs e)
FILE: Brenner.SilentCmd/LogWriter.cs
class LogWriter (line 7) | internal class LogWriter : IDisposable
method Initialize (line 21) | public void Initialize(string logPath = null, bool append = false, lon...
method RotateLogFile (line 40) | private void RotateLogFile()
method Dispose (line 60) | public void Dispose()
method WriteLine (line 76) | public void WriteLine(string format, params object[] args)
FILE: Brenner.SilentCmd/Program.cs
class Program (line 5) | public static class Program
method Main (line 10) | [STAThread]
FILE: Brenner.SilentCmd/Properties/Resources.Designer.cs
class Resources (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Resources (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: Brenner.SilentCmd/Properties/Settings.Designer.cs
class Settings (line 14) | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
Condensed preview — 22 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (54K chars).
[
{
"path": ".gitignore",
"chars": 61,
"preview": ".vs\nbin\nobj\nDebug\nRelease\n*.DotSettings\n*.user\n*.suo\npackages"
},
{
"path": "Brenner.SilentCmd/ArgumentParser.cs",
"chars": 744,
"preview": "using System.Globalization;\n\nnamespace Brenner.SilentCmd\n{\n public static class ArgumentParser\n {\n public "
},
{
"path": "Brenner.SilentCmd/Brenner.SilentCmd.csproj",
"chars": 6024,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "Brenner.SilentCmd/Configuration.cs",
"chars": 2875,
"preview": "using Brenner.SilentCmd.Properties;\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing S"
},
{
"path": "Brenner.SilentCmd/Engine.cs",
"chars": 4259,
"preview": "using System;\nusing System.Diagnostics;\nusing System.Reflection;\nusing System.Windows.Forms;\nusing Brenner.SilentCmd.Pr"
},
{
"path": "Brenner.SilentCmd/LogWriter.cs",
"chars": 2830,
"preview": "using System;\nusing System.Diagnostics;\nusing System.IO;\n\nnamespace Brenner.SilentCmd\n{\n internal class LogWriter : "
},
{
"path": "Brenner.SilentCmd/Program.cs",
"chars": 357,
"preview": "using System;\n\nnamespace Brenner.SilentCmd\n{\n public static class Program\n {\n /// <summary>\n /// Th"
},
{
"path": "Brenner.SilentCmd/Properties/AssemblyInfo.cs",
"chars": 1387,
"preview": "using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled "
},
{
"path": "Brenner.SilentCmd/Properties/Resources.Designer.cs",
"chars": 5247,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code w"
},
{
"path": "Brenner.SilentCmd/Properties/Resources.resx",
"chars": 6877,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "Brenner.SilentCmd/Properties/Settings.Designer.cs",
"chars": 3360,
"preview": "//------------------------------------------------------------------------------\n// <auto-generated>\n// This code w"
},
{
"path": "Brenner.SilentCmd/Properties/Settings.settings",
"chars": 1140,
"preview": "<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\""
},
{
"path": "Brenner.SilentCmd/app.config",
"chars": 1561,
"preview": "<?xml version=\"1.0\"?>\n<configuration>\n<configSections>\n <sectionGroup name=\"applicationSettings\" type=\"System.Configu"
},
{
"path": "Brenner.SilentCmd.Tests/Brenner.SilentCmd.Tests.csproj",
"chars": 5294,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbui"
},
{
"path": "Brenner.SilentCmd.Tests/ConfigurationTest.cs",
"chars": 1462,
"preview": "using System;\nusing Xunit;\n\nnamespace Brenner.SilentCmd.Tests\n{\n public class ConfigurationTest\n {\n [Fact]"
},
{
"path": "Brenner.SilentCmd.Tests/Dummy.cmd",
"chars": 119,
"preview": "@echo off\necho This is a test batch file for SilentCMD\necho Parameter 1: %1\necho Date: %date%\nTIMEOUT /T 5\nexit /B 1234"
},
{
"path": "Brenner.SilentCmd.Tests/Properties/AssemblyInfo.cs",
"chars": 1476,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "Brenner.SilentCmd.Tests/TestDelay.cmd",
"chars": 123,
"preview": "@echo off\n\"%~dp0\\..\\Brenner.SilentCmd\\bin\\Debug\\SilentCMD.exe\" \"%~dp0\\Dummy.cmd\" param /LOG:\"%temp%\\TestDelay.log\" /DELA"
},
{
"path": "Brenner.SilentCmd.Tests/packages.config",
"chars": 718,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n <package id=\"xunit\" version=\"2.4.1\" targetFramework=\"net452\" />\n <"
},
{
"path": "LICENSE",
"chars": 1083,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2011 Stephan Brenner\n\nPermission is hereby granted, free of charge, to any person o"
},
{
"path": "README.md",
"chars": 1663,
"preview": "# SilentCMD\n\nSilentCMD executes a batch file without opening the command prompt window. If required, the console output "
},
{
"path": "SilentCmd.sln",
"chars": 1639,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.28307.168\nMi"
}
]
About this extraction
This page contains the full source code of the stbrenner/SilentCMD GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 22 files (49.1 KB), approximately 12.3k tokens, and a symbol index with 29 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.