Skip to content

Instantly share code, notes, and snippets.

@shaneramey
Created October 7, 2014 18:28
Show Gist options
  • Save shaneramey/a482ba0c4bf830e3546b to your computer and use it in GitHub Desktop.
Save shaneramey/a482ba0c4bf830e3546b to your computer and use it in GitHub Desktop.
Computing IP Broadcast Address with VBScript
Here’s a simple script to calculate the broadcast address of a network using its IP address and subnet mask (VBScript)
subnetMaskBytes = Split(“255.255.255.0″, “.”)
ipAddressBytes = Split(“10.1.122.100″, “.”)
broadcastAddress = (ipAddressBytes(0) Or (subnetMaskBytes(0) Xor 255)) & “.” & (ipAddressBytes(1) Or (subnetMaskBytes(1) Xor 255)) & “.” & (ipAddressBytes(2) Or (subnetMaskBytes(2) Xor 255)) & “.” & (ipAddressBytes(3) Or (subnetMaskBytes(3) Xor 255))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment