in reply to wpa and wpa2-psk

You haven't given us much to go on. You might like to consider the following steps:

Sane operating systems tend to come with scripts suitable to connect to networks, needing only some editing of a configuration file. I suspect Windows would be harder to script, but maybe some work with Win32::OLE or indeed PowerShell might do the trick.

Also look at How (Not) To Ask A Question.