falahati / NetworkAdapterSelector

A simple solution to let you force bind a program to a specific network adapter
GNU General Public License v2.0
229 stars 38 forks source link

Can i bind adapter without using shell extension #3

Closed Lemonpartyy closed 7 years ago

Lemonpartyy commented 7 years ago

Hello, can some1 advice how can i bind my adapter, using shortcut (like forcebindip) Or give me please example

falahati commented 7 years ago

Command Line Parameters:

Network identification is the network GUID. To get those you can run the following commands in the CMD:

net start "Wired AutoConfig"
net start "WLAN AutoConfig"
netsh lan show interfaces
netsh wlan show interfaces

Or use the following in a PowerShell window:

[System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces()

Or you can use the registry and read them from here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\NetworkCards

Example for attaching to an already running process: (PID 1234)

NetworkAdapterSelector.Hook.exe --network "{ABCDEFGH-0000-0000-0000-000000000000}" --attach 1234

Example for starting a new application:

NetworkAdapterSelector.Hook.exe --network "{ABCDEFGH-0000-0000-0000-000000000000}" --execute "C:\Windows\System32\notepad.exe" -t 1000
Lemonpartyy commented 7 years ago

Thank you very much for this constructive post

Lemonpartyy commented 7 years ago

May i ask you again, if i do not discract you NetworkAdapterSelector.Hook.exe --network "{ABCDEFGH-0000-0000-0000-000000000000}" --execute "C:\Windows\System32\notepad.exe" --delay 1000 -c " -width 800 -height 600 " This is the correct use of args option? I can not figure this out

falahati commented 7 years ago

Yes, this should work, do you have any problem with it?

Lemonpartyy commented 7 years ago

My apologies, it's work perfect, i was a bit inconsiderate, thank you.