Appendix C. Essential Command-Line Utilities for Use with WSH

Command-line utilities provide some of the most powerful and useful features you'll find anywhere. Using command-line utilities, you often can replace dozens of lines of code with a few simple statements. As you explore Windows you'll find that hundreds of utilities are available and all of them can be run within your Windows scripts.

In this appendix, we've selected the top utilities that you may want to use. You'll find a quick reference for commands as well as detailed entries on command usage and syntax. All examples show command-line and Windows script syntax.

ARP

ARP -a [inet_addr] [-N if_addr]
ARP -d inet_addr [if_addr]
ARP -s inet_addr eth_addr [if_addr]

eth_addr

Sets the physical MAC address in hexadecimal format, such as HH-HH-HH-HH-HH-HH where H is a hexadecimal value from 0 to F. Each network adapter card has a built-in MAC address.

if_addr

Sets the IP address of the interface whose address translation table should be modified. If you don't specify an address, the first available interface is used.

inet_addr

Sets an Internet address.

-a

Displays current ARP entries.

-d

Deletes the specified entry.

-g

Same as -a.

-N if_addr

Displays the ARP entries for the network interface specified by if_addr.

-s

Adds the host and associates the Internet address inet_addr with the physical address eth_addr. The physical address is given as six hexadecimal bytes separated by hyphens. The entry is permanent.

Details:

ARP displays and modifies the ...

Get Microsoft® PowerShell, VBScript and JScript® Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.