I. Before You Begin
The procedure below will not affect the data on your device in any way, but do make a backup of important data before you proceed as a precaution.
II. Necessary Downloads
ICS404root.zip
III. Rooting the Motorola Droid 4
1. Enable USB Debugging on your device. To do this, head to Settings > Development and check the Enable USB Debugging tickbox.
2. Connect your device to your Windows PC and change the type of connection to Windows Media Sync instead of Mass Storage.
3. Extract the ICS404root.zip file you downloaded above to a folder on your desktop.
4. From the extracted folder, double-click rootscript.bat to run the script.
5. Hit Enter once you have made sure that you have enabled USB Debugging and the device is in Camera Mode.
Another tutorial
How to Install CM10 Jelly Bean Update on Motorola Droid Razr
The procedure below will not affect the data on your device in any way, but do make a backup of important data before you proceed as a precaution.
II. Necessary Downloads
ICS404root.zip
III. Rooting the Motorola Droid 4
1. Enable USB Debugging on your device. To do this, head to Settings > Development and check the Enable USB Debugging tickbox.
2. Connect your device to your Windows PC and change the type of connection to Windows Media Sync instead of Mass Storage.
3. Extract the ICS404root.zip file you downloaded above to a folder on your desktop.
4. From the extracted folder, double-click rootscript.bat to run the script.
5. Hit Enter once you have made sure that you have enabled USB Debugging and the device is in Camera Mode.
Another tutorial
How to Install CM10 Jelly Bean Update on Motorola Droid Razr