Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a desktop connected to the internet and to my home network through Wi-Fi, and a laptop connected to said desktop through an Ethernet cable. But Windows seems to only reach the laptop through Wi-Fi: I want to transfer files through the wired connection instead.

Setting up Internet Connection Sharing and disconnecting the laptop from Wi-Fi altogether doesn't seem like the most elegant solution to me. I also thought about going to the hosts file and setting up the IP address manually, but that would make the laptop completely unavailable if it's not wired, which happens quite often unfortunately.

Is there any way for me to tell Windows to use the wired connection for a particular host if possible, and fallback to any other route it finds otherwise?

share|improve this question
You could try changing the interface metrics on the machine, whether this helps when being connected to, I don't know.… – Oct 1 '11 at 1:09
Changing the metrics would force Windows to use the wired connection for everything, including internet access which it does not have, since the desktop is connected to my router through Wi-Fi. –  danielkza Oct 1 '11 at 2:14

3 Answers 3

up vote 3 down vote accepted

I believe I found a solution. I was thinking, and what I want is to basically subvert Windows' hostname lookup, since it is righfully looking up computers on the wireless network first (it has the lower metric after all, since it has an internet connection). Then I remembered there's a file exactly for that: the lmhosts file.

Adding a map from the notebook's hostname to it's wired IP works exactly as I want: Windows first tries to reach it through Ethernet, but falls back to NetBIOS/DNS lookup if it's not accessible, and then finds the wireless IP. I thought hostname caching might be a problem, but apparently the lmhosts file is looked up even before the cache.

TL;DR: Adding the wired IP of the notebook to the lmhosts.sam (at %windir%\system32\drivers\etc) file works flawlessly. Thanks for all the helpful answers!

share|improve this answer
I might need this someday, can you give example of USE with this method? and can you have simeltanious I/O ? –  Psycogeek Oct 1 '11 at 3:48
Well, that's the whole content of my lmhosts.sam file: danielkza-note. What happens now is that when I try to reach daniel-note, it will go to the notebooks wired IP ( if the cable is connected, or to the wireless IP ( otherwise. It's plain host name aliasing, so I don't get what you ask by simultaneous I/O. –  danielkza Oct 1 '11 at 3:51
Now that you have it set up, what kinds of things can you do on the computer with both connections, Like can you Surf the web, and transfer files? Have open files via the other computer, and download? just any example of how you use both. Nevermind, I see FALLBACK now in the question . –  Psycogeek Oct 1 '11 at 3:59

It looks like you haven't configured wired interfaces. You need to assign an IP address to each connected interface. Take a look at how to assign a static IP address.

For example, use the IP address and netmask on your desktop and the IP address with netmask on the laptop.

After that you can reach the laptop's shares from the desktop using the address \\ . On the desktop put that address in the Windows Explorer Address bar or in Run... window (Win+R).

share|improve this answer
That's exactly what I dont want. I can reach the computer through the IP perfectly, but I want the hostname to point to the wired interface's IP instead of the wireless'. I have many services configured through the hostname (ssh, rsync, synergy, etc) and I'd rather not mess with them all if possible. –  danielkza Oct 1 '11 at 2:14

From what I can tell the wireless tromps the wired when it comes to connecting without control in the windows systems. This is based on the "metric" (priority) set for that network item.

If everything else is working correctally ,and you could normally connect to either of them , Disabling the wireless connection in Network stuff , will disable the wireless (duh). The working and correct wired connection will immediataly be used instead. (re-enabling wireless the system will start using wireless again) the inner workings of that are beyond me, it just does.

I can hop from wired to wireless in the push of a shortcut button in my windows XP system, by device disable methods. I use the tool "devcon" (device connect), put it in a script to shut the devices on and off at will, and at a whim for testing. (talk about secure, it is off)

Anybody want to learn it, I could show you, I use most simplistic methods (dolt) as possible so I can debug, alter, and control, so this shouldnt be That hard.

This is a XP script for One device, my Nic Card itself, which I had previously Identified by its cryptic junk that the system shows me when doing a Devcon "find".

Simple switch, check to see if it is running or not, toggle it, tell me what happend.

echo OFF

C:\Desk\batch\DEVCON.exe >"%USERPROFILE%\Local Settings\Temp\Rescheck" status *811A1043*
FIND /I /C "RUNNING" "%USERPROFILE%\Local Settings\Temp\Rescheck"

start /B "beeps" C:\Desk\batch\wav.exe C:\WINDOWS\Media\AppSounds\netdetecto.wav
ECHO  driver is probably running disable it
C:\Desk\batch\DEVCON.exe disable *811A1043*


echo driver is probably not running enable it
start /B "beeps" C:\Desk\batch\wav.exe C:\WINDOWS\Media\AppSounds\netdetectc.wav
C:\Desk\batch\DEVCON.exe enable *811A1043*


That wasnt so bad was it :-) of course it could be done in 1/3rd that, but it has to keep me informed.

Break it down

run the command Devcon.exe. > send the output to some temp wherever. do a status . * Wildcard * some aspect of the device ID simply partial ID of device.

Check the simple text file FIND. look for the text running /I /C "RUNNING". in the temp

If the above fails because running is not found IF %ERRORLEVEL% GTR 0. Then go to the tag GOTO NOTRUN

If it goes to that tag :NOTRUN then enable the device DEVCON.exe ENABLE wildcarded Device numbers

Go to the Device manager in your system to see hardware names, and even IDs on some systems.

The simplest way to see device ID things from devcons perspective, is to do a devcon.exe /find and to simply start applying your wildcards * now to reduce the list.

To make things easy, dont even bother with Full ID or hwid , it will only cause frustration, use the wildcards, just get enough ID so it is different, test that manually using /find, test using /enable ,with the wildcards.

Devcon DL;EN-US;Q311272 (now in both 32bit and 64 bit 78K zip file)

share|improve this answer
I don't want to disable Wi-Fi: I acccess the Internet through it. I just want Windows to see it can reach the notebook by Ethernet and use it instead of Wi-Fi. Disabling Wi-Fi is not an option :( –  danielkza Oct 1 '11 at 2:15
Ahh, so you want Both at the same time? To be able to transfer files around between computers with the wired, and get your web stuff via the Wireless? That is completely different. the system is not normally capable of that because of the 2 IPs thing (xp did not allow easy 2 seperate IPs). There is a method that is used by servers , and a program for users if I can find it again. –  Psycogeek Oct 1 '11 at 2:26
we normally use a USB lap-link type item for this type of 2nd connection, because it is simple as can be, secure being local, and fast being usb (now Gig-lan can be faster). It connects via USB to both computers, then has buffers in a Box on the wires, a sort of direct connect, and far less net junk for me (lazy me) –  Psycogeek Oct 1 '11 at 2:38
here is one of the ideas made for working 2 IPs in the same system and this, which is simlar problem for different intent… is ICS looking good at this point :-) –  Psycogeek Oct 1 '11 at 2:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.