Created
October 7, 2014 18:28
-
-
Save shaneramey/a482ba0c4bf830e3546b to your computer and use it in GitHub Desktop.
Computing IP Broadcast Address with VBScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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