Can someone help me? I would need to determine NT / W2k service pack level from somewhere with my script.. from registry? with some command line tool?

I tried winmsd /f, it created file and I could find the string from there but registry sounds easier if I just could find it somewhere..

thanks
timo