When you are connected to the wireless network, there will be a router somewhere in the system with a DHCP server to allocate IP addresses to the various computers connected to it. When you disconnect from wireless network, your laptops no longer have any way to get their IP addresses.
If you open a Command Prompt window and run the command:
details of all adapters in the PC will be displayed. Now run:
which will release the current addresses and should set them to 0.0.0.0 Now run:
This would normally renew the addresses with the DHCP server. However, in the absence of a DHCP server, Windows should allocate APIPA (Automatic Private IP Addressing) addresses in the 169.254.0.0 range. This may let you run file sharing provided any firewall software is configured to allow access to the networked PCs.
The better option is to allocate fixed IP addresses, such as 192.168.0.1 and 192.168.0.2 with the same Subnet Mask of 255.255.255.0, to the two laptops.