That's simple ;p
Just make a new .txt file, insert
showcdkey.exe >> c:\mycdkey.txt
and save it as mycdkey.bat or something like that.
I attached the bat and the showcdkey.exe if someone don't get it working.
showcdkey.bat makes mycdkey.txt on c:\
and showcdkey2.bat just in the folder where you run the program (its your Diablo II folder because you have to put the files there
)