I think there's some confusion here. If you'd said it works when plugged into the router but not on wireless I would understand.
But what on earth has the battery got to do with it ? The laptop isn't drawing power from the router -- it connects to the internet via the router -- either by cable or by wireless.
To discover the wireless security code (passphrase) that has (presumably) been set in your router you need to refer to the literature which came with the router (or download the manual from the maker's site).
You should then be able to access the router's setup screens and note down the security passphrase and apply that to the wireless adapter's user interface (or Windows Networking). You also need to note which security type is being used in the router and supply that info to the wireless adapter's user interface (or Windows Networking).