Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Daltz333 committed Oct 12, 2018
0 parents commit a01e859
Show file tree
Hide file tree
Showing 35 changed files with 402 additions and 0 deletions.
25 changes: 25 additions & 0 deletions CortanaConfigurator.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2041
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CortanaConfigurator", "CortanaConfigurator\CortanaConfigurator.csproj", "{EF9B9046-0E92-41B1-A263-0D2D748C03A1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EF9B9046-0E92-41B1-A263-0D2D748C03A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF9B9046-0E92-41B1-A263-0D2D748C03A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF9B9046-0E92-41B1-A263-0D2D748C03A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF9B9046-0E92-41B1-A263-0D2D748C03A1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {601F576C-2246-474F-810E-B4ACBDAFDE8D}
EndGlobalSection
EndGlobal
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added CortanaConfigurator/870666_200_K4E_icon.ico
Binary file not shown.
6 changes: 6 additions & 0 deletions CortanaConfigurator/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
121 changes: 121 additions & 0 deletions CortanaConfigurator/CortanaConfigurator.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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>{EF9B9046-0E92-41B1-A263-0D2D748C03A1}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>CortanaConfigurator</RootNamespace>
<AssemblyName>Cortana Configurator</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<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.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject>ConsoleApp1.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>cortana_icon_3YL_icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>9325FC8165529518CBE3914A6252B0DB31440A4D</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Management.Automation.dll.10.0.10586.0\lib\net40\System.Management.Automation.dll</HintPath>
</Reference>
<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" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
<None Include="Properties\app.manifest">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="870666_200_K4E_icon.ico" />
<Content Include="cortana_icon_3YL_icon.ico" />
</ItemGroup>
<ItemGroup>
<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" />
</Project>
13 changes: 13 additions & 0 deletions CortanaConfigurator/CortanaConfigurator.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>
117 changes: 117 additions & 0 deletions CortanaConfigurator/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Management.Automation;
using System.Collections.ObjectModel;

namespace ConsoleApp1
{
class Program
{

static void Main(string[] args)
{

Console.WriteLine("Cortana Enabler/Disabler! Written by Dalton Smith");
Console.WriteLine("Guarenteed working as of Windows 10 OS Build 17763.55");
Console.WriteLine("=============================================");
Console.WriteLine();
Console.Write("Type Enable(1) or Disable(2) Cortana? ");

if (!int.TryParse(Console.ReadLine(), out int option))
{
option = 0;
}
;
String enabled = "";

if (option == 1)
{
enabled = "Set-ItemProperty -Path $path -Name \"AllowCortana\" -Value 1";

} else if (option == 2)
{
enabled = "Set-ItemProperty -Path $path -Name \"AllowCortana\" -Value 0";

} else if (option == 0)
{
Console.WriteLine("Your input was invalid");
}

Console.WriteLine();

if (enabled != "")
{
//create powershell instance
PowerShell powerInstance = PowerShell.Create();
powerInstance.AddScript("New-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\" -Name \"Windows Search\"");

powerInstance.AddScript("$path = \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\"");
powerInstance.AddScript(enabled);
powerInstance.AddScript("Stop-Process -name explorer");
powerInstance.Invoke();
if (option == 1)
{
Console.WriteLine("Enabled Cortana");
}
else
{
Console.WriteLine("Disabled Cortana");
}

}
else
{
Console.WriteLine("There was an error, please restart the application");
Console.Read();
}

if (option == 2)
{
Console.WriteLine();
Console.WriteLine("=============================================");
Console.WriteLine("Would you also like to uninstall the Cortana Process?");
Console.WriteLine("Please note that this is not possible on later Windows versions");
Console.WriteLine("Uninstalling Cortana Process will also disable Windows Search");
Console.Write("Uninstall y/n? ");
String uninstall = Console.ReadLine();

if (uninstall == "y")
{
PowerShell powerInstance = PowerShell.Create();
powerInstance.AddScript("Get-AppxPackage | Where-Object {$_.Name -eq ‘Microsoft.Windows.Cortana’} | Select-String “Cortana”");
var results = powerInstance.Invoke();

StringBuilder stringBuilder = new StringBuilder();


foreach (PSObject obj in results)
{
stringBuilder.AppendLine(obj.ToString());
}

String delete = stringBuilder.ToString();
powerInstance.AddScript("Remove-AppxPackage " + delete);
powerInstance.Invoke();
Console.WriteLine("Uninstalled Cortana");
}
else
{
//do nothing
}

}

Console.WriteLine();
Console.WriteLine("You may now close the program");
Console.Read();

}

}
}
36 changes: 36 additions & 0 deletions CortanaConfigurator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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("Cortana Configurator")]
[assembly: AssemblyDescription("Uses the power of Powershell and C# to bitch slap Cortana into submission")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Dalton Smith")]
[assembly: AssemblyProduct("Cortana Configurator")]
[assembly: AssemblyCopyright("Copyright Dalton Smith - 2018")]
[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("ef9b9046-0e92-41b1-a263-0d2d748c03a1")]

// 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")]
70 changes: 70 additions & 0 deletions CortanaConfigurator/Properties/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />s
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
Binary file added CortanaConfigurator/cortana_icon_3YL_icon.ico
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3c3ca03f307ad3380e54a8a35d80d5be0b530f63
Loading

0 comments on commit a01e859

Please sign in to comment.