Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cmd 'patch' is not recognised as an internal/external command, operable program or batch file

Tags:

cmd

I'm trying to patch my wordpress installation to protect from user enumeration. I found a patch - here

It said to use it I need to navigate to the sites root folder, add the patch file then run it using cmd , patch -p0 <wpuserEnum.patch

When I hit enter I get the 'patch' is not recognised as an internal/external command, operable program or batch file' message

Not the most helpful error reporting. I have googled the problem all day and have not found any solutions regarding 'patch' specifically

I have checked PATH and there is a C:\Windows\System32 path there

Can anybody shed any light on what is happening and why?

I am running Windows Server 2008.

like image 418
user1750332 Avatar asked Oct 16 '12 14:10

user1750332


2 Answers

patch is not part of Windows so it won't be installed unless you install it yourself. You can get it as part of the GnuWin32 project - http://gnuwin32.sourceforge.net/packages/patch.htm

like image 176
shf301 Avatar answered Jan 03 '23 19:01

shf301


You need to edit your system environment variables, then add the path to patch.exe(in GnuWin32\bin) to the PATH environment variable...after restarting the cmd, patch should be recognized...

like image 43
Fazi Avatar answered Jan 03 '23 20:01

Fazi