diff --git a/Misc/NEWS.d/next/Build/2021-03-31-19-50-01.bpo-43567.vd0a-p.rst b/Misc/NEWS.d/next/Build/2021-03-31-19-50-01.bpo-43567.vd0a-p.rst
new file mode 100644
index 00000000000..062662f6bce
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2021-03-31-19-50-01.bpo-43567.vd0a-p.rst
@@ -0,0 +1 @@
+Improved generated code refresh (AST/tokens/opcodes/keywords) on Windows.
diff --git a/PCbuild/_freeze_importlib.vcxproj b/PCbuild/_freeze_importlib.vcxproj
index a0fe49c464d..52d8f1a64bb 100644
--- a/PCbuild/_freeze_importlib.vcxproj
+++ b/PCbuild/_freeze_importlib.vcxproj
@@ -140,10 +140,12 @@
Condition="!Exists(%(None.OutFile)) or (Exists(%(None.IntFile)) and '$([System.IO.File]::ReadAllText(%(None.OutFile)).Replace(`
`, `
`))' != '$([System.IO.File]::ReadAllText(%(None.IntFile)).Replace(`
`, `
`))')">
-
-
+
-
+
+
git
diff --git a/PCbuild/regen.targets b/PCbuild/regen.targets
new file mode 100644
index 00000000000..4d386cfa5f3
--- /dev/null
+++ b/PCbuild/regen.targets
@@ -0,0 +1,84 @@
+
+
+
+
+ $(PYTHON)
+
+
+
+
+ <_PegenSources Include="$(PySourcePath)Grammar\python.gram;$(PySourcePath)Grammar\Tokens" />
+ <_PegenOutputs Include="$(PySourcePath)Parser\parser.c" />
+ <_ASTSources Include="$(PySourcePath)Parser\Python.asdl" />
+ <_ASTOutputs Include="$(PySourcePath)Include\internal\pycore_ast.h">
+ -H
+
+ <_ASTOutputs Include="$(PySourcePath)Include\internal\pycore_ast_state.h">
+ -I
+
+ <_ASTOutputs Include="$(PySourcePath)Python\Python-ast.c">
+ -C
+
+ <_OpcodeSources Include="$(PySourcePath)Tools\scripts\generate_opcode_h.py;$(PySourcePath)Lib\opcode.py" />
+ <_OpcodeOutputs Include="$(PySourcePath)Include\opcode.h;$(PySourcePath)Python\opcode_targets.h" />
+ <_TokenSources Include="$(PySourcePath)Grammar\Tokens" />
+ <_TokenOutputs Include="$(PySourcePath)Doc\library\token-list.inc">
+ rst
+
+ <_TokenOutputs Include="$(PySourcePath)Include\token.h">
+ h
+
+ <_TokenOutputs Include="$(PySourcePath)Parser\token.c">
+ c
+
+ <_TokenOutputs Include="$(PySourcePath)Lib\token.py">
+ py
+
+ <_KeywordSources Include="$(PySourcePath)Grammar\python.gram;$(PySourcePath)Grammar\Tokens" />
+ <_KeywordOutputs Include="$(PySourcePath)Lib\keyword.py" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/PCbuild/regen.vcxproj b/PCbuild/regen.vcxproj
deleted file mode 100644
index ef355a21820..00000000000
--- a/PCbuild/regen.vcxproj
+++ /dev/null
@@ -1,215 +0,0 @@
-
-
-
-
- Debug
- ARM
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- PGInstrument
- ARM
-
-
- PGInstrument
- Win32
-
-
- PGInstrument
- x64
-
-
- PGUpdate
- ARM
-
-
- PGUpdate
- Win32
-
-
- PGUpdate
- x64
-
-
- Release
- ARM
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
- {21CF2108-2CC9-4005-A6ED-B7965ADE3854}
- Win32Proj
- regen
- false
- 10.0
-
-
-
-
- Utility
- Unicode
-
-
- v142
-
-
- v142
-
-
- v142
-
-
- v142
-
-
- v142
-
-
- v142
-
-
- v142
-
-
- v142
-
-
- v142
-
-
- v142
-
-
- v142
-
-
- v142
-
-
-
-
-
-
-
-
-
-
-
- _CONSOLE;%(PreprocessorDefinitions)
-
-
- Console
-
-
-
-
-
-
-
- {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}
- true
- true
- false
- true
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-