$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:

After disconnecting from all networks:

Introduced in 2017
 (11.2)