Script to use rhnreg_ks to register to RHN

Hi,

I have Redhat 5.6

I would like to have the script that will don a NONE interactive mode to register Linux Redhat to Satellite server without any interaction from user.

i found command but i never get to working:

#rhnreg_ks

i want also to at the same time upload all rpm against the Satellite server during registration.

If you could provide scripting, syntax...i would appreciate it.

Thank you in advance.