diff --git a/Misc/NEWS.d/next/Windows/2020-04-01-18-44-11.bpo-40145.oG7AzX.rst b/Misc/NEWS.d/next/Windows/2020-04-01-18-44-11.bpo-40145.oG7AzX.rst
new file mode 100644
index 000000000000000..0f4fd2fbd501971
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2020-04-01-18-44-11.bpo-40145.oG7AzX.rst
@@ -0,0 +1,4 @@
+Tweaked the pcbuild options for pyshellext to reduce the size of the binary.
+Since this is a very simple component, there really isn't much benefit of
+optimizing for speed, likely the slowest part of this component's lifetime
+is simply loading it. Total size reduction is approx 40% in release builds.
diff --git a/PCbuild/pcbuild.sln b/PCbuild/pcbuild.sln
index 61db4e02ad38370..4b6dc1e6771dc3d 100644
--- a/PCbuild/pcbuild.sln
+++ b/PCbuild/pcbuild.sln
@@ -1267,6 +1267,38 @@ Global
{384C224A-7474-476E-A01B-750EA7DE918C}.Release|Win32.Build.0 = Release|Win32
{384C224A-7474-476E-A01B-750EA7DE918C}.Release|x64.ActiveCfg = Release|x64
{384C224A-7474-476E-A01B-750EA7DE918C}.Release|x64.Build.0 = Release|x64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Debug|ARM.ActiveCfg = Debug|ARM
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Debug|ARM.Build.0 = Debug|ARM
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Debug|ARM64.Build.0 = Debug|ARM64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Debug|Win32.Build.0 = Debug|Win32
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Debug|x64.ActiveCfg = Debug|x64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Debug|x64.Build.0 = Debug|x64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGInstrument|ARM.ActiveCfg = PGInstrument|ARM
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGInstrument|ARM.Build.0 = PGInstrument|ARM
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGInstrument|ARM64.ActiveCfg = PGInstrument|ARM64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGInstrument|ARM64.Build.0 = PGInstrument|ARM64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGInstrument|x64.Build.0 = PGInstrument|x64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGUpdate|ARM.ActiveCfg = PGUpdate|ARM
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGUpdate|ARM.Build.0 = PGUpdate|ARM
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGUpdate|ARM64.ActiveCfg = PGUpdate|ARM64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGUpdate|ARM64.Build.0 = PGUpdate|ARM64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.PGUpdate|x64.Build.0 = PGUpdate|x64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Release|ARM.ActiveCfg = Release|ARM
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Release|ARM.Build.0 = Release|ARM
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Release|ARM64.ActiveCfg = Release|ARM64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Release|ARM64.Build.0 = Release|ARM64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Release|Win32.ActiveCfg = Release|Win32
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Release|Win32.Build.0 = Release|Win32
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Release|x64.ActiveCfg = Release|x64
+ {FCBE1EF2-E0F0-40B1-88B5-00A35D378742}.Release|x64.Build.0 = Release|x64
{78D80A15-BD8C-44E2-B49E-1F05B0A0A687}.Debug|ARM.ActiveCfg = Debug|ARM
{78D80A15-BD8C-44E2-B49E-1F05B0A0A687}.Debug|ARM.Build.0 = Debug|ARM
{78D80A15-BD8C-44E2-B49E-1F05B0A0A687}.Debug|ARM64.ActiveCfg = Debug|ARM64
diff --git a/PCbuild/pyshellext.vcxproj b/PCbuild/pyshellext.vcxproj
index 655054e3723b431..d31caf153457ecf 100644
--- a/PCbuild/pyshellext.vcxproj
+++ b/PCbuild/pyshellext.vcxproj
@@ -78,6 +78,81 @@
DynamicLibrary
Unicode
+
+
+
+ true
+
+
+ false
+
+
+
+
+
+ true
+
+
+ false
+
+
+
+
+ true
+
+
+ false
+
+
+
+
+ true
+
+
+ false
+
+
+
+
+ true
+
+
+ false
+
+
+
+
+ true
+
+
+ false
+
+
+
+
+ true
+
+
+ false
+
+
+
+
+ true
+
+
+ false
+
+
+
+
+ true
+
+
+ false
+
+
+
@@ -92,11 +167,156 @@
_CONSOLE;%(PreprocessorDefinitions)
+
+
+
+ MinSpace
+ AnySuitable
+ Size
+ false
+
+
+
+
+ MinSpace
+ AnySuitable
+ Size
+ false
+
+
+
+
+ MinSpace
+ AnySuitable
+ Size
+ false
+
+
+
+
+ MinSpace
+ AnySuitable
+ Size
+ false
+
+
+
+
+ MinSpace
+ AnySuitable
+ Size
+ false
+
+
+
+
+ MinSpace
+ AnySuitable
+ Size
+ false
+
+
+
+
+ MinSpace
+ AnySuitable
+ Size
+ false
+
+
+
+
+ MinSpace
+ AnySuitable
+ Size
+ false
+
+
+
+
+ MinSpace
+ AnySuitable
+ Size
+ false
+
+
+
+ /Zo
+ /Zo
+ /Zo
+ /Zo
+ /Zo
+ /Zo
+ /Zo
+ /Zo
+ /Zo
+ /Zo
+ /Zo
+ /Zo
+
+ MinSpace
+ AnySuitable
+ Size
+ true
+ MinSpace
+ AnySuitable
+ Size
+ true
+ MinSpace
+ AnySuitable
+ Size
+ true
+ false
+ false
+ false
version.lib;shlwapi.lib;%(AdditionalDependencies)
Console
..\PC\pyshellext$(PyDebugExt).def
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ UseLinkTimeCodeGeneration
+ true
+ true
+ UseLinkTimeCodeGeneration
+ true
+ true
+ true
+ true
+ UseLinkTimeCodeGeneration
+ true
+ true
+ UseLinkTimeCodeGeneration
+ true
+ true
+ DebugFull
+ DebugFull
+ DebugFull
+ DebugFull
+ DebugFull
+ DebugFull
+ DebugFull
+ DebugFull
+ DebugFull
+ DebugFull
+ DebugFull
+ DebugFull
+ true
+ true
+ UseLinkTimeCodeGeneration
+ true
+ true
+ UseLinkTimeCodeGeneration
+ true
+ true
+ UseLinkTimeCodeGeneration
true