Last updated 6 September 2009.

If you only need patch, download the standalone program from Sourceforge.

Note: patch on Windows requires CRLF line-endings; see also Common problems.

To integrate with double click:

  1. Create a patch.bat file in the same folder as patch.exe that contains
    @echo off
    cd /d %~dp1
    %~dp0patch.exe -p0 < %1
  2. Right click on any patch file (i.e. drupal.patch) and select Open With.
  3. Select newly created patch.bat file.

Windows Vista Users: To prevent patch from always requiring administrator rights do the following. In the same folder as your patch.exe file create a file named patch.exe.manifest In that file place the following.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
	<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
	<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> 
				<requestedExecutionLevel level="asInvoker"/> 


Steven Jones’s picture

I downloaded and installed patch on Vista, but the standard Drupal command line for patch didn't work, instead I used:

patch -p0 -i patch_file.patch


sinasalek’s picture

If you have a problem with this program, i suggest you to have a look at this thread
and specially this comments :
Feel freedom with open source softwares, Software Manager & Lead developer
Feel freedom with open source softwares

digitalfreak’s picture

after intalling the patch, i just spend 30 mins to figure out how to use in command-line, and then I just realize i have to add the the directory where the "patch.exe" file is located in the "PATH" variable in window environment (I am using XP, btw), and please also invoke the command in "cmd" in the form of patch.exe < file.patch instead of just patch < file.patch (I assume here that your patch was not made relative to the Drupal root directory you can place the patch in the same directory as the file being patched and run the patch)

aniskhan’s picture

This is the only command that worked for me on Windows XP 64-bit:

patch -p0 -b --verbose --binary -i thefile.diff

GiorgosK’s picture

This is the command that has worked for my .bat file on winXP 32bit

c:\patch -p0 < %1.patch --binary
Xomby’s picture

For anyone having permissions issues with vista/Win7, try renaming patch.exe and patch.bat to something else (that does NOT include the word patch). such as pash.exe or pch.exe...

Heuristic UAC sniffers pick up on the word "patch" in the filename, and will cause UAC issues every time, however I had no UAC issues with pash.exe/pash.bat etc.