diff --git a/WmiExplorer/ChangeLog.txt b/WmiExplorer/ChangeLog.txt index 4ac0b67..2dec812 100644 --- a/WmiExplorer/ChangeLog.txt +++ b/WmiExplorer/ChangeLog.txt @@ -1,6 +1,7 @@ Version 2.0.0.2 [10-05-2017] * Migration to GitHub. + * Added option to specify COMPUTERNAME as a parameter and automatically connect, Example: WmiExplorer.exe COMPUTERNAME. Version 2.0.0.0 [10-27-2014] diff --git a/WmiExplorer/WmiExplorer.Functions.Designer.cs b/WmiExplorer/WmiExplorer.Functions.Designer.cs index 72f6e0a..9d4e971 100644 --- a/WmiExplorer/WmiExplorer.Functions.Designer.cs +++ b/WmiExplorer/WmiExplorer.Functions.Designer.cs @@ -1746,6 +1746,17 @@ namespace WmiExplorer SetStatusBar2(String.Empty, MessageCategory.Error); } + private void ProcessCommandLineArgs() + { + string[] args = Environment.GetCommandLineArgs(); + + if (args.Length == 2) + { + textBoxComputerName.Text = args[1].ToString(); + buttonComputerConnect.PerformClick(); + } + } + private void PopulateClassProperties(WmiClass wmiClass) { ResetListClassProperties(); diff --git a/WmiExplorer/WmiExplorer.cs b/WmiExplorer/WmiExplorer.cs index 65b0885..7a3f0fe 100644 --- a/WmiExplorer/WmiExplorer.cs +++ b/WmiExplorer/WmiExplorer.cs @@ -1618,6 +1618,7 @@ namespace WmiExplorer private void WmiExplorer_Load(object sender, EventArgs e) { InitializeForm(); + ProcessCommandLineArgs(); } } } \ No newline at end of file