viewtopic.php?f=19&t=1783
espprog-001234567890-1d4hty5u7okmm74r
First part tells the esp having the mac address of the second part to consider the third part the password of a new AP. We don't care which AP, it can try all available until it connects. Perhaps other data like server address could also be passed.
Obviously some issues: security, possible length of netwok name, ease of creating ad-hoc network on PC, user feedback to confirm it worked and so on. For windows I could see a simple GUI program handling the whole thing assuming proper rights.