Init Commit
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
obj/
|
||||||
|
bin/
|
||||||
|
.vs/
|
BIN
Demo/screenshot.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2019 Olivier Giniaux
|
||||||
|
|
||||||
|
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.
|
37
OpenCmdHere.sln
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 15
|
||||||
|
VisualStudioVersion = 15.0.28010.2003
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenCmdHere", "OpenCmdHere\OpenCmdHere.csproj", "{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {8E12D7AF-41D3-4885-B0BB-2EA60909A541}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
61
OpenCmdHere/ContextMenu.cs
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using SharpShell.Attributes;
|
||||||
|
using SharpShell.SharpContextMenu;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Drawing;
|
||||||
|
using OpenCmdHere.Properties;
|
||||||
|
|
||||||
|
namespace OpenCmdHere {
|
||||||
|
|
||||||
|
[ComVisible(true)]
|
||||||
|
[COMServerAssociation(AssociationType.Class, @"Directory\Background")]
|
||||||
|
public class ContextMenu : SharpContextMenu {
|
||||||
|
|
||||||
|
protected override bool CanShowMenu() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override ContextMenuStrip CreateMenu() {
|
||||||
|
|
||||||
|
var contextMenu = new ContextMenuStrip();
|
||||||
|
|
||||||
|
var menuItem = new ToolStripMenuItem("Open Cmd Here", GetBitmap());
|
||||||
|
menuItem.Click += (sender, args) => openCmdHere();
|
||||||
|
contextMenu.Items.Add(menuItem);
|
||||||
|
|
||||||
|
return contextMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openCmdHere() {
|
||||||
|
var pinfo = new ProcessStartInfo();
|
||||||
|
pinfo.UseShellExecute = true;
|
||||||
|
pinfo.WorkingDirectory = FolderPath;
|
||||||
|
pinfo.FileName = "cmd.exe";
|
||||||
|
Process process = Process.Start(pinfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Bitmap GetBitmap() {
|
||||||
|
if (Extensions.Dpi > 0.96f * 250 - 1) {
|
||||||
|
return (Bitmap)Resources.ResourceManager.GetObject("Console40", Resources.Culture);
|
||||||
|
}
|
||||||
|
if (Extensions.Dpi > 0.96f * 225 - 1) {
|
||||||
|
return (Bitmap)Resources.ResourceManager.GetObject("Console36", Resources.Culture);
|
||||||
|
}
|
||||||
|
if (Extensions.Dpi > 0.96f * 200 - 1) {
|
||||||
|
return (Bitmap)Resources.ResourceManager.GetObject("Console32", Resources.Culture);
|
||||||
|
}
|
||||||
|
if (Extensions.Dpi > 0.96f * 175 - 1) {
|
||||||
|
return (Bitmap)Resources.ResourceManager.GetObject("Console28", Resources.Culture);
|
||||||
|
}
|
||||||
|
if (Extensions.Dpi > 0.96f * 150 - 1) {
|
||||||
|
return (Bitmap)Resources.ResourceManager.GetObject("Console24", Resources.Culture);
|
||||||
|
}
|
||||||
|
if (Extensions.Dpi > 0.96f * 125 - 1) {
|
||||||
|
return (Bitmap)Resources.ResourceManager.GetObject("Console20", Resources.Culture);
|
||||||
|
}
|
||||||
|
return (Bitmap)Resources.ResourceManager.GetObject("Console16", Resources.Culture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
44
OpenCmdHere/Extensions.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace OpenCmdHere {
|
||||||
|
|
||||||
|
public static class Extensions {
|
||||||
|
|
||||||
|
public static T[] Add<T>(this T[] target, params T[] items) {
|
||||||
|
// Validate the parameters
|
||||||
|
if (target == null) {
|
||||||
|
target = new T[] { };
|
||||||
|
}
|
||||||
|
if (items == null) {
|
||||||
|
items = new T[] { };
|
||||||
|
}
|
||||||
|
|
||||||
|
// Join the arrays
|
||||||
|
T[] result = new T[target.Length + items.Length];
|
||||||
|
target.CopyTo(result, 0);
|
||||||
|
items.CopyTo(result, target.Length);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static float _Dpi = -1;
|
||||||
|
public static float Dpi {
|
||||||
|
get {
|
||||||
|
if (_Dpi == -1) {
|
||||||
|
using (Graphics graphics = Graphics.FromHwnd(IntPtr.Zero)) {
|
||||||
|
_Dpi = graphics.DpiY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _Dpi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[System.Runtime.InteropServices.DllImport("Shell32.dll")]
|
||||||
|
private static extern int SHChangeNotify(int eventId, int flags, IntPtr item1, IntPtr item2);
|
||||||
|
|
||||||
|
public static void RefreshExplorer() {
|
||||||
|
SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
OpenCmdHere/Key.snk
Normal file
116
OpenCmdHere/OpenCmdHere.csproj
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProductVersion>8.0.30703</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{31EFBD02-1FCC-4EC6-A7F3-5A04BE4AE806}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>OpenCmdHere</RootNamespace>
|
||||||
|
<AssemblyName>OpenCmdHere</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<SccProjectName>
|
||||||
|
</SccProjectName>
|
||||||
|
<SccLocalPath>
|
||||||
|
</SccLocalPath>
|
||||||
|
<SccAuxPath>
|
||||||
|
</SccAuxPath>
|
||||||
|
<SccProvider>
|
||||||
|
</SccProvider>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\</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\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignAssembly>true</SignAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="SharpShell, Version=2.6.0.0, Culture=neutral, PublicKeyToken=f14dc899472fe6fb, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\Tools\SharpShell.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="ContextMenu.cs" />
|
||||||
|
<Compile Include="Extensions.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Key.snk" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Resources\Console16.png" />
|
||||||
|
<Content Include="Resources\Console20.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Resources\Console24.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Resources\Console28.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Resources\Console32.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Resources\Console36.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Resources\Console40.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<PostBuildEvent>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</PropertyGroup>
|
||||||
|
<!-- 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>
|
36
OpenCmdHere/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
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("OpenCmdHere")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("OpenCmdHere")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||||
|
[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("b8ae651d-0143-420d-9b65-b356ab2c3d67")]
|
||||||
|
|
||||||
|
// 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")]
|
133
OpenCmdHere/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Ce code a été généré par un outil.
|
||||||
|
// Version du runtime :4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
|
||||||
|
// le code est régénéré.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace OpenCmdHere.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
|
||||||
|
/// </summary>
|
||||||
|
// Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
|
||||||
|
// à l'aide d'un outil, tel que ResGen ou Visual Studio.
|
||||||
|
// Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
|
||||||
|
// avec l'option /str ou régénérez votre projet VS.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.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>
|
||||||
|
/// Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
|
||||||
|
/// </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("OpenCmdHere.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remplace la propriété CurrentUICulture du thread actuel pour toutes
|
||||||
|
/// les recherches de ressources à l'aide de cette classe de ressource fortement typée.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Console16 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Console16", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Console20 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Console20", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Console24 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Console24", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Console28 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Console28", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Console32 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Console32", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Console36 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Console36", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
|
||||||
|
/// </summary>
|
||||||
|
internal static System.Drawing.Bitmap Console40 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("Console40", resourceCulture);
|
||||||
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
142
OpenCmdHere/Properties/Resources.resx
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
<?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>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="Console16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\Console16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="Console20" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\Console20.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="Console24" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\Console24.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="Console28" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\Console28.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="Console32" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\Console32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="Console36" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\Console36.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="Console40" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\Console40.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
BIN
OpenCmdHere/Resources/Console16.png
Normal file
After Width: | Height: | Size: 422 B |
BIN
OpenCmdHere/Resources/Console20.png
Normal file
After Width: | Height: | Size: 484 B |
BIN
OpenCmdHere/Resources/Console24.png
Normal file
After Width: | Height: | Size: 545 B |
BIN
OpenCmdHere/Resources/Console28.png
Normal file
After Width: | Height: | Size: 555 B |
BIN
OpenCmdHere/Resources/Console32.png
Normal file
After Width: | Height: | Size: 625 B |
BIN
OpenCmdHere/Resources/Console36.png
Normal file
After Width: | Height: | Size: 537 B |
BIN
OpenCmdHere/Resources/Console40.png
Normal file
After Width: | Height: | Size: 641 B |
10
README.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Open Cmd Here
|
||||||
|
A Windows shell tool to open a new command line window at the current folder location (a.k.a. Cmd, DOS, batch, ...).
|
||||||
|
|
||||||
|
This feature was natively available in Windows 10 until a few years ago when it got replaced with powershell.
|
||||||
|
This tool enables this open command window in the current directory again !
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
# Usage
|
||||||
|
Download and install the latest version in the release tab.
|
BIN
Tools/ComRegTool.exe
Normal file
BIN
Tools/SharpShell.dll
Normal file
65
installer.nsi
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
!define VERSION "1.0"
|
||||||
|
|
||||||
|
; The name of the installer
|
||||||
|
Name "Open Cmd Here"
|
||||||
|
|
||||||
|
; The file to write
|
||||||
|
OutFile "OpenCmdHere-${VERSION}-win64.exe"
|
||||||
|
|
||||||
|
; The default installation directory
|
||||||
|
InstallDir "$PROGRAMFILES\Open Cmd Here"
|
||||||
|
|
||||||
|
; Registry key to check for directory (so if you install again, it will
|
||||||
|
; overwrite the old one automatically)
|
||||||
|
InstallDirRegKey HKLM "SOFTWARE\Open Cmd Here" "Install_Dir"
|
||||||
|
|
||||||
|
; Request application privileges for Windows Vista
|
||||||
|
RequestExecutionLevel admin
|
||||||
|
|
||||||
|
Page components
|
||||||
|
Page directory
|
||||||
|
Page instfiles
|
||||||
|
|
||||||
|
UninstPage uninstConfirm
|
||||||
|
UninstPage instfiles
|
||||||
|
|
||||||
|
; The stuff to install
|
||||||
|
Section "Open Cmd Here(required)"
|
||||||
|
|
||||||
|
SectionIn RO
|
||||||
|
|
||||||
|
; Set output path to the installation directory.
|
||||||
|
SetOutPath $INSTDIR
|
||||||
|
|
||||||
|
File "Tools\ComRegTool.exe"
|
||||||
|
File "OpenCmdHere\bin\OpenCmdHere.dll"
|
||||||
|
File "OpenCmdHere\bin\SharpShell.dll"
|
||||||
|
|
||||||
|
Exec '"$INSTDIR\ComRegTool.exe" install register "$INSTDIR\OpenCmdHere.dll"'
|
||||||
|
|
||||||
|
; Write the installation path into the registry
|
||||||
|
WriteRegStr HKLM "SOFTWARE\Open Cmd Here" "Install_Dir" "$INSTDIR"
|
||||||
|
|
||||||
|
; Write the uninstall keys for Windows
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Open Cmd Here" "DisplayName" "Open Cmd Here"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Open Cmd Here" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
||||||
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Open Cmd Here" "NoModify" 1
|
||||||
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Open Cmd Here" "NoRepair" 1
|
||||||
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||||
|
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
Section "Uninstall"
|
||||||
|
|
||||||
|
; Remove registry keys
|
||||||
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Open Cmd Here"
|
||||||
|
DeleteRegKey HKLM "SOFTWARE\Open Cmd Here"
|
||||||
|
|
||||||
|
; Unregister COM server
|
||||||
|
ExecWait '"$INSTDIR\ComRegTool.exe" uninstall unregister "$INSTDIR\OpenCmdHere.dll"'
|
||||||
|
|
||||||
|
; Remove directories used
|
||||||
|
RMDir "$SMPROGRAMS\Open Cmd Here"
|
||||||
|
RMDir /r "$INSTDIR"
|
||||||
|
|
||||||
|
SectionEnd
|
2
register.cmd
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
set path=%~dp0
|
||||||
|
"%path%Tools\ComRegTool.exe" install register "%path%OpenCmdHere\bin\OpenCmdHere.dll"
|
2
unregister.cmd
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
set path=%~dp0
|
||||||
|
"%path%Tools\ComRegTool.exe" uninstall unregister "%path%OpenCmdHere\bin\OpenCmdHere.dll"
|