diff --git a/Misc/NEWS b/Misc/NEWS
index 3a331e81516..59db14f3e2d 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -92,6 +92,10 @@ Documentation
Build
-----
+- Issue #19788: kill_python(_d).exe is now run as a PreBuildEvent on the
+ pythoncore sub-project. This should prevent build errors due a previous
+ build's python(_d).exe still running.
+
- Add workaround for VS 2010 nmake clean issue. VS 2010 doesn't set up PATH
for nmake.exe correctly.
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 29493e399b7..89a63d10154 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -181,6 +181,12 @@
libc;%(IgnoreSpecificDefaultLibraries)
0x1e000000
+
+ $(KillPythonExe)
+
+
+ Killing any running $(PythonExe) instances...
+
@@ -206,6 +212,12 @@
libc;%(IgnoreSpecificDefaultLibraries)
0x1e000000
+
+ $(KillPythonExe)
+
+
+ Killing any running $(PythonExe) instances...
+
@@ -231,6 +243,12 @@
libc;%(IgnoreSpecificDefaultLibraries)
0x1e000000
+
+ $(KillPythonExe)
+
+
+ Killing any running $(PythonExe) instances...
+
@@ -259,6 +277,12 @@
libc;%(IgnoreSpecificDefaultLibraries)
0x1e000000
+
+ $(KillPythonExe)
+
+
+ Killing any running $(PythonExe) instances...
+
@@ -282,6 +306,12 @@
libc;%(IgnoreSpecificDefaultLibraries)
0x1e000000
+
+ $(KillPythonExe)
+
+
+ Killing any running $(PythonExe) instances...
+
@@ -308,6 +338,12 @@
0x1e000000
MachineX64
+
+ $(KillPythonExe)
+
+
+ Killing any running $(PythonExe) instances...
+
@@ -331,6 +367,12 @@
libc;%(IgnoreSpecificDefaultLibraries)
0x1e000000
+
+ $(KillPythonExe)
+
+
+ Killing any running $(PythonExe) instances...
+
@@ -357,6 +399,12 @@
0x1e000000
MachineX64
+
+ $(KillPythonExe)
+
+
+ Killing any running $(PythonExe) instances...
+
diff --git a/Tools/buildbot/build-amd64.bat b/Tools/buildbot/build-amd64.bat
index 7ee7b2d9b36..493e74de5a3 100644
--- a/Tools/buildbot/build-amd64.bat
+++ b/Tools/buildbot/build-amd64.bat
@@ -2,6 +2,5 @@
cmd /c Tools\buildbot\external-amd64.bat
call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64
cmd /c Tools\buildbot\clean-amd64.bat
-msbuild PCbuild\kill_python.vcxproj /p:Configuration=Debug /p:PlatformTarget=x64
-PCbuild\amd64\kill_python_d.exe
+
msbuild PCbuild\pcbuild.sln /p:Configuration=Debug /p:Platform=x64
diff --git a/Tools/buildbot/build.bat b/Tools/buildbot/build.bat
index c93cfd554bd..be79b10726d 100644
--- a/Tools/buildbot/build.bat
+++ b/Tools/buildbot/build.bat
@@ -2,7 +2,6 @@
cmd /c Tools\buildbot\external.bat
call "%VS100COMNTOOLS%vsvars32.bat"
cmd /c Tools\buildbot\clean.bat
-msbuild PCbuild\kill_python.vcxproj /p:Configuration=Debug /p:PlatformTarget=x86
-PCbuild\kill_python_d.exe
+
msbuild PCbuild\pcbuild.sln /p:Configuration=Debug /p:Platform=Win32