This is a short bat program to create a self signed key (with private key), if you call the bat "makecertif.bat", to create a key named ServerKey you need to type :
makecertif.bat ServerKey, it will create ServerKey.pfx, a certificate with a private key you can use to secure a web site in IIS, or to secure a WCF service or to use to authenticate a client.
You need to put the script in Windows SDK bin directory (mine is C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin).
makecert -r -pe -n "CN=CompanyXYZ Server" -b 01/01/2007 -e 01/01/2012 -sky exchange %1.cer -sv %1.pvk
pvk2pfx.exe -pvk %1.pvk -spc %1.cer -pfx %1.pfx
del %1.cer
del %1.pvk