├── Screenshots ├── 1.png ├── 2.jpg └── 3.gif ├── Windows-run-tool ├── Icon │ ├── logo.ico │ └── logo.png ├── packages.config ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Helper │ ├── EnvironmentVariablesExtension.cs │ ├── FileExtension.cs │ ├── WebHelper.cs │ ├── DirectoryExtension.cs │ ├── WinAPI.cs │ ├── RegisterExtension.cs │ └── RegexHelper.cs ├── Compare │ └── RunItemComparer.cs ├── App.xaml ├── Resources │ ├── lang │ │ ├── zh-CN.xaml │ │ └── en-US.xaml │ ├── rundll32.txt │ └── shell.txt ├── Model │ └── RunItem.cs ├── Windows-run-tool.sln ├── App.xaml.cs ├── MainWindow.xaml ├── Windows-run-tool.csproj └── MainWindow.xaml.cs ├── LICENSE ├── todo.txt ├── .gitignore └── README.md /Screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhaotianff/Windows-run-tool/HEAD/Screenshots/1.png -------------------------------------------------------------------------------- /Screenshots/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhaotianff/Windows-run-tool/HEAD/Screenshots/2.jpg -------------------------------------------------------------------------------- /Screenshots/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhaotianff/Windows-run-tool/HEAD/Screenshots/3.gif -------------------------------------------------------------------------------- /Windows-run-tool/Icon/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhaotianff/Windows-run-tool/HEAD/Windows-run-tool/Icon/logo.ico -------------------------------------------------------------------------------- /Windows-run-tool/Icon/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhaotianff/Windows-run-tool/HEAD/Windows-run-tool/Icon/logo.png -------------------------------------------------------------------------------- /Windows-run-tool/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Windows-run-tool/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Windows-run-tool/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Windows-run-tool/Helper/EnvironmentVariablesExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Windows_run_tool.Helper 8 | { 9 | public class EnvironmentVariablesExtension 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Windows-run-tool/Compare/RunItemComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Windows_run_tool.Model; 8 | 9 | namespace Windows_run_tool.Compare 10 | { 11 | public class RunItemComparer : IEqualityComparer 12 | { 13 | public bool Equals(RunItem x, RunItem y) 14 | { 15 | return x.Name == y.Name; 16 | } 17 | 18 | public int GetHashCode(RunItem obj) 19 | { 20 | return obj.GetHashCode(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Windows-run-tool/Helper/FileExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Windows_run_tool.IO 8 | { 9 | public static class FileExtension 10 | { 11 | public static string GetFileDescription(string filePath) 12 | { 13 | try 14 | { 15 | return System.Diagnostics.FileVersionInfo.GetVersionInfo(filePath).FileDescription; 16 | } 17 | catch 18 | { 19 | return ""; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Windows-run-tool/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Windows-run-tool/Helper/WebHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Windows_run_tool.Helper 9 | { 10 | public class WebHelper 11 | { 12 | public async static Task GetHtmlSource(string url) 13 | { 14 | System.Net.Http.HttpClient httpClient = new System.Net.Http.HttpClient(); 15 | using (Stream stream = await httpClient.GetStreamAsync(url)) 16 | { 17 | using(StreamReader sr = new StreamReader(stream,Encoding.UTF8)) 18 | { 19 | return await sr.ReadToEndAsync(); 20 | } 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Windows-run-tool/Resources/lang/zh-CN.xaml: -------------------------------------------------------------------------------- 1 | 4 | 运行项 5 | 路径 6 | 描述 7 | 选中的命令 8 | 启动 9 | 确定 10 | 导出 11 | txt文件 12 | 导出成功 13 | 导出失败 14 | 15 | -------------------------------------------------------------------------------- /Windows-run-tool/Resources/lang/en-US.xaml: -------------------------------------------------------------------------------- 1 | 4 | Run item 5 | Path 6 | Description 7 | Command 8 | Run 9 | OK 10 | Export 11 | txt file 12 | Export success 13 | Export failed 14 | -------------------------------------------------------------------------------- /Windows-run-tool/Helper/DirectoryExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Windows_run_tool.IO 8 | { 9 | public static class DirectoryExtension 10 | { 11 | public static List GetFiles(string path,params string[] extensions) 12 | { 13 | var list = new List(); 14 | 15 | try 16 | { 17 | var files = System.IO.Directory.GetFiles(path); 18 | 19 | foreach (var item in files) 20 | { 21 | var extension = System.IO.Path.GetExtension(item); 22 | 23 | if (extensions.Contains(extension)) 24 | list.Add(item); 25 | } 26 | 27 | return list; 28 | } 29 | catch 30 | { 31 | return list; 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Windows-run-tool/Helper/WinAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Windows_run_tool.Helper 9 | { 10 | public class WinAPI 11 | { 12 | private const int MAX_PATH = 260; 13 | 14 | [DllImport("Kernel32.dll")] 15 | private static extern int GetShortPathName(string lpszLongPath, StringBuilder lpszShortPath, int cchBuffer); 16 | 17 | /// 18 | /// https://www.cnblogs.com/zhaotianff/p/12524947.html 19 | /// 20 | /// 21 | /// 22 | public static string ShortenPath(string path) 23 | { 24 | StringBuilder shortPath = new StringBuilder(MAX_PATH); 25 | GetShortPathName(path, shortPath, MAX_PATH); 26 | return shortPath.ToString(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 ZTI 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Windows-run-tool/Model/RunItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Runtime.InteropServices; 7 | using Windows_run_tool.Helper; 8 | 9 | namespace Windows_run_tool.Model 10 | { 11 | public class RunItem 12 | { 13 | public string Name { get; set; } 14 | public string Description { get; set; } 15 | public string Path { get; set; } 16 | 17 | public override string ToString() 18 | { 19 | if(Name.StartsWith("ms-settings")) 20 | { 21 | return $"{Name.PadRight(100, ' ')}{Description}"; 22 | } 23 | else 24 | { 25 | var shortPath = WinAPI.ShortenPath(Path); 26 | 27 | if(string.IsNullOrEmpty(shortPath)) 28 | { 29 | shortPath = Path; 30 | } 31 | 32 | return $"{Name.PadRight(45, ' ')}{shortPath.PadRight(55, ' ')}{Description}"; 33 | } 34 | 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Windows-run-tool/Helper/RegisterExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Windows_run_tool.Reg 8 | { 9 | public static class RegisterExtension 10 | { 11 | public static List GetRegItem(Microsoft.Win32.RegistryKey key,string path) 12 | { 13 | try 14 | { 15 | var regKey = key.OpenSubKey(path); 16 | return regKey.GetSubKeyNames().ToList(); 17 | } 18 | catch 19 | { 20 | return new List(); 21 | } 22 | } 23 | 24 | public static string GetRegValue(Microsoft.Win32.RegistryKey key,string path,string name) 25 | { 26 | try 27 | { 28 | var regKey = key.OpenSubKey(path); 29 | 30 | if (regKey == null) 31 | return ""; 32 | 33 | return regKey.GetValue(name,"").ToString(); 34 | } 35 | catch 36 | { 37 | return ""; 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Windows-run-tool/Windows-run-tool.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.902 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Windows-run-tool", "Windows-run-tool.csproj", "{244D98C5-CEEA-4C6D-B34C-FB5AA517054A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {244D98C5-CEEA-4C6D-B34C-FB5AA517054A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {244D98C5-CEEA-4C6D-B34C-FB5AA517054A}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {244D98C5-CEEA-4C6D-B34C-FB5AA517054A}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {244D98C5-CEEA-4C6D-B34C-FB5AA517054A}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {D8BC5197-2F76-4127-9DA9-EA579B351AF5} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Windows-run-tool/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Windows_run_tool.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Windows-run-tool/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Globalization; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | using System.Windows; 9 | 10 | namespace Windows_run_tool 11 | { 12 | /// 13 | /// App.xaml 的交互逻辑 14 | /// 15 | public partial class App : Application 16 | { 17 | protected override void OnStartup(StartupEventArgs e) 18 | { 19 | base.OnStartup(e); 20 | LoadLanguage(); 21 | } 22 | private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) 23 | { 24 | MessageBox.Show(e.Exception.Message); 25 | e.Handled = true; 26 | } 27 | 28 | private void LoadLanguage() 29 | { 30 | var lang = CultureInfo.CurrentCulture.Name; 31 | var path = ""; 32 | 33 | if(lang == "zh-CN") 34 | { 35 | path = "Resources/lang/zh-CN.xaml"; 36 | } 37 | else 38 | { 39 | path = "Resources/lang/en-US.xaml"; 40 | } 41 | 42 | ResourceDictionary resourceDictionary = new ResourceDictionary() { Source = new Uri(path, UriKind.Relative) }; 43 | System.Windows.Application.Current.Resources.MergedDictionaries[0] = resourceDictionary; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Windows-run-tool/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("Windows-run-tool")] 11 | [assembly: AssemblyDescription("Windows-run-tool")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("Windows-run-tool")] 15 | [assembly: AssemblyCopyright("Copyright © zhaotianff 2020")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 52 | // 方法是按如下所示使用“*”: : 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("5.0.0.0")] 55 | [assembly: AssemblyFileVersion("5.0.0.0")] 56 | -------------------------------------------------------------------------------- /Windows-run-tool/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | 43 |