alias getprog return $regread($+(HKCR\,$regread($+(HKCR\.,$gettok($1,-1,46),\)),\shell\open\command\))

//echo -a $getprog(file.jpg)

Returns program name in case the extension is associated with something, otherwise returns nothing. Works on Win98se.

Also, make sure your $regread doesn't prefix the returned value with 'OK' because that would break this alias.