Modem AT commands through script

Hello,

  1. how can i execute modem commands through script?
    For example i need to send ussd command.
  2. In Russia when mobile balance is 0 - your mobile service is stopping, then when you put money to provider you need register again your cell phone or 3g modem in mobile network. Is there a way to disable and re-initialize the mobile network.