try it:
C:\windows\system32\sc.exe create GlassfishV2 binPath= "C:\Program
Files\Sun\glassfish-beta3\lib\appservService.exe \"C:\Progra~1\Sun\glassfish-beta3\bin\asadmin.bat start-domain --user admin
domain1\" \"C:\Progra~1\Sun\glassfish-beta3\bin\asadmin.bat
stop-domain domain1\"" start= auto DisplayName= "GlassfishV2"
[Message sent by forum member 'heinzedario' (heinzedario)]
http://forums.java.net/jive/thread.jspa?messageID=230922