Can TBWinRE choose Ethernet over wireless, if present?

User discussion and information resource forum for Image products.
Post Reply
PsychBiller
Posts: 61
Joined: Sun Aug 05, 2012 4:45 pm

Can TBWinRE choose Ethernet over wireless, if present?

Post by PsychBiller »

I built a TBWinRE USB flash drive to image my laptop. Sometimes I connect it to Ethernet and other times, I use WiFi. My TBWinRE build connects to the wireless interface even if Ethernet is present. Is there a way to opt for Ethernet in InitScript.CMD if it is available? A backup over Ethernet would be way faster.

I'd also like to execute some commands conditionally in InitScript.CMD: do certain things if the machine name is X, other things if it is Y, and use the Read from Volume option on drives encrypted with BitLocker. Are any of those things possible?
TeraByte Support(PP)
Posts: 1644
Joined: Fri Aug 12, 2011 12:51 am

Re: Can TBWinRE choose Ethernet over wireless, if present?

Post by TeraByte Support(PP) »

I assume they are both the same network. You'd may need to check if ethernet is connected and if it is, then don't connect to Wi-Fi. For example, check if ethernet IP address assigned or try to map your share and if it fails then connect Wi-Fi and try again.

It doesn't look up the machine name (and wouldn't be able to in some cases). However, you could tag the systems (with a file, for example) and then check for those in your script and adjust accordingly.
PsychBiller
Posts: 61
Joined: Sun Aug 05, 2012 4:45 pm

Re: Can TBWinRE choose Ethernet over wireless, if present?

Post by PsychBiller »

Yes, same LAN. How would I check in the script that an Ethernet IP address has been assigned? I know the command but how can the script parse that out?

What scripting language is used for InitScript.CMD? Something home brewed or a standard Windows script of some kidn?
TeraByte Support(PP)
Posts: 1644
Joined: Fri Aug 12, 2011 12:51 am

Re: Can TBWinRE choose Ethernet over wireless, if present?

Post by TeraByte Support(PP) »

It's just a normal batch/.cmd script file. There are lots of tutorials out there. Search web for "batch scripts commands", "cmd commands", "cmd script commands", etc.

This is an example that just looks for an existing IPv4 address. You would need to add your Wi-Fi connection commands to the correct place and the rest of your commands to the end (connecting to your network share, etc.).

Code: Select all

:: Check if IP exists
(set netip=)
for /f "usebackq tokens=2 delims=:" %%B in (`ipconfig ^| find "IPv4"`) do set netip=%%B & set netip=!netip:~1!
if defined netip echo Network IPv4 found: %netip% & goto :skipWiFi
echo Network IPv4 not found

:: Connect Wi-Fi
echo Connecting to Wi-Fi...
:: put wi-fi connection commands here

:skipWiFi
echo Network connected...
:: continue with script commands here
PsychBiller
Posts: 61
Joined: Sun Aug 05, 2012 4:45 pm

Re: Can TBWinRE choose Ethernet over wireless, if present?

Post by PsychBiller »

Awesome! Thank you!
Post Reply