| mystuff |
Your IP Address is: 38.107.191.104 |
| home | wsname | wallpaper creator | delphi stuff | vb script stuff | other stuff | contact me |
|
|
Here's a collection of Visual Basic (vb) Script functions I've collected over the years. Services Check if a particular service is running File System Delete a file Find a file if it's in the path Find the CDROM Drive Find CDROM Drive with Media Generate a filename and path for a working file in the %temp% directory Find the size of a file Find the location of PST files and log them in a SQL database Network Renew a DHCP lease Ping a host (using WMI) Ping a host using the external ping.exe Convert an IP Address Mask to Slashed Notation Set a static IP address from a text file Registry Search through the registry using recursion Misc Including common functions and statement in your scripts Open the Control Panel Dialogue to the "Connections" option Convert a Binary File to a String Check if you're running on a Desktop or Laptop Working With Data Files (INI, XML, SQL) files Using SQL to Generate a Self Incrementing Computer Naming System Read a Value from an INI File (GetINI) Write to an INI file (WriteINI) Read a whole section of an INI file Write a whole section to an INI file Read a value from an XML file LDAP, AD, Exchange etc Get User Information from an Exchange 5.5 GAL Check to see if a User Account Exists in AD Get Members of an AD Group Update the Terminal Services Profile Path to point to a new Server Set Exchange 'Send As' and 'Receive As' Permissions
This function will convert and IP address mask to its slashed notation ie "255.255.0.0" = "/16" usage: Wscript.echo MaskToSlashedNotation("255.255.0.0") Function MaskToSlashedNotation(sMask) Dim table, aSubnetOctets table = Array( _ 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, _ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, _ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, _ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, _ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, _ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, _ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, _ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8) aSubnetOctets = split(sMask, ".", 4) MaskToSlashedNotation = "/" & (table(aSubnetOctets(0)) + table(aSubnetOctets(1)) + table(aSubnetOctets(2)) + table(aSubnetOctets(3))) End Function |