Skip to content

Instantly share code, notes, and snippets.

@rsola
Last active May 10, 2024 16:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsola/8e6df0803183fd4972c1 to your computer and use it in GitHub Desktop.
Save rsola/8e6df0803183fd4972c1 to your computer and use it in GitHub Desktop.
Remove DirectX redist components
@echo off
REM This command-line interpreter batch file removes all of the DirectX
REM redistributable DLLs from SysWOW64 (64-bit Windows only) and System32
REM folders. It should be used as a last resort to troubleshoot versioning
REM issues and processor architecture conflicts. No output is given.
REM Must be run with administrator privileges (elevated). It will fail
REM silently otherwise.
REM You should restore the delete files by using the DirectX End-User
REM Runtime Web Installer from Microsoft. It requires an active connection
REM to the Internet during the setup.
REM https://www.microsoft.com/en-us/download/details.aspx?id=35&
REM
REM Alternatively, you can download the DirectX End-User Runtimes (June 2010)
REM package, directx_Jun2010_redist.exe. It will ask for a folder and extract
REM all DirectX redistributable files there. Then, you should run Dxsetup.exe.
REM https://www.microsoft.com/en-us/download/details.aspx?id=8109
REM Start deleting files from System32
pushd %windir%\system32
call :delete
popd
REM Check for 64-bit Windows and delete files from SysWOW64
if not exist %windir%\syswow64\nul goto :eof
if not "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto :eof
pushd %windir%\syswow64
call :delete
popd
goto :eof
:delete
del /q d3dcompiler_33.dll 2> nul
del /q d3dcompiler_34.dll 2> nul
del /q d3dcompiler_35.dll 2> nul
del /q d3dcompiler_36.dll 2> nul
del /q D3DCompiler_37.dll 2> nul
del /q D3DCompiler_38.dll 2> nul
del /q D3DCompiler_39.dll 2> nul
del /q D3DCompiler_40.dll 2> nul
del /q D3DCompiler_41.dll 2> nul
del /q D3DCompiler_42.dll 2> nul
del /q D3DCompiler_43.dll 2> nul
del /q d3dcsx_42.dll 2> nul
del /q d3dcsx_43.dll 2> nul
del /q d3dx9_24.dll 2> nul
del /q d3dx9_25.dll 2> nul
del /q d3dx9_26.dll 2> nul
del /q d3dx9_27.dll 2> nul
del /q d3dx9_28.dll 2> nul
del /q d3dx9_29.dll 2> nul
del /q d3dx9_30.dll 2> nul
del /q d3dx9_31.dll 2> nul
del /q d3dx9_32.dll 2> nul
del /q d3dx9_33.dll 2> nul
del /q d3dx9_34.dll 2> nul
del /q d3dx9_35.dll 2> nul
del /q d3dx9_36.dll 2> nul
del /q d3dx9_37.dll 2> nul
del /q d3dx9_38.dll 2> nul
del /q d3dx9_39.dll 2> nul
del /q d3dx9_40.dll 2> nul
del /q d3dx9_41.dll 2> nul
del /q d3dx9_42.dll 2> nul
del /q d3dx9_43.dll 2> nul
del /q d3dx10.dll 2> nul
del /q d3dx10_33.dll 2> nul
del /q d3dx10_34.dll 2> nul
del /q d3dx10_35.dll 2> nul
del /q d3dx10_36.dll 2> nul
del /q d3dx10_37.dll 2> nul
del /q d3dx10_38.dll 2> nul
del /q d3dx10_39.dll 2> nul
del /q d3dx10_40.dll 2> nul
del /q d3dx10_41.dll 2> nul
del /q d3dx10_42.dll 2> nul
del /q d3dx10_43.dll 2> nul
del /q d3dx11_42.dll 2> nul
del /q d3dx11_43.dll 2> nul
del /q x3daudio1_0.dll 2> nul
del /q x3daudio1_1.dll 2> nul
del /q x3daudio1_2.dll 2> nul
del /q X3DAudio1_3.dll 2> nul
del /q X3DAudio1_4.dll 2> nul
del /q X3DAudio1_5.dll 2> nul
del /q X3DAudio1_6.dll 2> nul
del /q X3DAudio1_7.dll 2> nul
del /q xactengine2_0.dll 2> nul
del /q xactengine2_1.dll 2> nul
del /q xactengine2_2.dll 2> nul
del /q xactengine2_3.dll 2> nul
del /q xactengine2_4.dll 2> nul
del /q xactengine2_5.dll 2> nul
del /q xactengine2_6.dll 2> nul
del /q xactengine2_7.dll 2> nul
del /q xactengine2_8.dll 2> nul
del /q xactengine2_9.dll 2> nul
del /q xactengine2_10.dll 2> nul
del /q xactengine3_0.dll 2> nul
del /q xactengine3_1.dll 2> nul
del /q xactengine3_2.dll 2> nul
del /q xactengine3_3.dll 2> nul
del /q xactengine3_4.dll 2> nul
del /q xactengine3_5.dll 2> nul
del /q xactengine3_6.dll 2> nul
del /q xactengine3_7.dll 2> nul
del /q XAPOFX1_0.dll 2> nul
del /q XAPOFX1_1.dll 2> nul
del /q XAPOFX1_2.dll 2> nul
del /q XAPOFX1_3.dll 2> nul
del /q XAPOFX1_4.dll 2> nul
del /q XAPOFX1_5.dll 2> nul
del /q XAudio2_0.dll 2> nul
del /q XAudio2_1.dll 2> nul
del /q XAudio2_2.dll 2> nul
del /q XAudio2_3.dll 2> nul
del /q XAudio2_4.dll 2> nul
del /q XAudio2_5.dll 2> nul
del /q XAudio2_6.dll 2> nul
del /q XAudio2_7.dll 2> nul
del /q xinput1_1.dll 2> nul
del /q xinput1_2.dll 2> nul
del /q xinput1_3.dll 2> nul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment