Short answer:
Update: The name of the preview is not the same for all RAW files. That's why Jener in the comment section succeeds with PreviewImage but not with JpgFromRaw. In general, if you have problems with the command, try the exiftool documentation page.
exiftool -b -JpgFromRaw IMG0001.NEF > test.jpg
Long answer:
Most RAW files contain not only the raw data that was captured when the picture was taken, but also a jpeg file which can be used to quickly show the image before the RAW has been completely interpreted.
Some programs that pretend to handle RAW files actually just extract the jpeg and displays that one to the user.
There is rarely any reason to extract the jpeg manually, but if you want to, you can use the command tool above using exiftool which is a tool available for Windows, Mac OS and Unix/Linux.
Just replace "IMG0001.NEF" with the name of your RAW file and "test.jpg" with the name of the jpeg you want to create.
Update: The name of the preview is not the same for all RAW files. That's why Jener in the comment section succeeds with PreviewImage but not with JpgFromRaw. In general, if you have problems with the command, try the exiftool documentation page.

