Sometimes my USB wireless network adapter doesn’t work at all after Windows 7 recovers from sleep mode. I haven’t found the root cause of this problem but disabling & enabling the adapter works well as a workaround. Here is a PowerShell script to do so:
Make sure the adapter name on line 3 matches what you have in Control Panel > Network and Internet > Network Connections. Mine is called “TP-LINK Wireless USB Adapter”.
Since you will need to run that as an Administrator, create a shortcut to the PowerShell executable and pass the full path of the script above as an argument. Then, open the shortcut properties, click on “Advanced…” and check “Run as an administrator”.
Update: This method only works on Windows Vista and above.
Update 2: I have not encountered this issue since I’ve updated to Windows 8.