$NetworkConnected

$NetworkConnected

gives True if your computer has a network interface that is active and capable of sending and receiving IP traffic, and False otherwise.

Details

  • $NetworkConnected gives True if your computer has an Ethernet, Wi-Fi, etc. connection that is active. It does not give True if your computer only has a Bluetooth connection without IP support.
  • $NetworkConnected also works in virtual machines.

Examples

Basic Examples  (1)

Check if your computer is connected to any network:

In[1]:=
Click for copyable input
Out[1]=

After disconnecting from all networks:

In[2]:=
Click for copyable input
Out[2]=

See Also

$CloudConnected  PingTime  HostLookup  URLResponseTime  $MachineAddresses

Tutorials

Introduced in 2017
(11.2)