While using OpenSSL on Windows:
openssl genrsa -out privatekey.pem 1024 -->
Created successfully
openssl req -new -x509 -key
In Windows 7 I didn't have to restart, simply run command prompt in administrator mode.