ASSOCIATE

ASSOCIATE (Available in Windows Resource Kit)

One step file association.
Associate utility combines the ASSOC and FTYPE commands. ASSOCIATE assigns an extension directly with an executable application and stored FileType to the system registry.

Syntax
ASSOCIATE .ext filename [/q /d /f]

Options:

.ext Extension to be associated.
filename Executable program to associate .ext with.
/q Quiet – Suppress interactive prompts.
/f Force – Force overwrite or delete without questions.
/d Delete – Delete the association.
/U  Display or set the association in HKCU\Software\Classes

A file extension is the last few characters in a FileName after the period. 

So a file called xyz.HTML has the file extension .HTML

The File extension is used by Windows NT to determine the type of information stored in the file and therefore which application(s) will be able to display the information in the file.
File extensions are not case sensitive and are not limited to 3 characters.

Example: adding a File Association

To add the File Type “abcFile”=Notepad.exe and also set the File Association of .abc=”abcFile” run this command:

ASSOCIATE .abc Notepad.exe

Example: Removing a File Association

ASSOCIATE .abc /d

Note that /d will delete the File Association but will NOT delete the File Type.

File types created by Associate.exe are always given a name in the form xxxfile, where xxx is the file extension.

ASSOC Command

Assoc command to change file extension association.

Assoc command to Display or change the association between a file extension and a fileType.

Syntax
ASSOC .ext = [fileType]
ASSOC

Key
.ext : The file extension
fileType : The type of file

last few characters in a FileName after the period(.) is called a file extension.
Ex.. XYZ.HTML has the file extension .HTML

The File extension is used by Windows NT to determine the type of information stored in the file and therefore which application(s) will be able to display the information in the file. File extensions are not case sensitive and are not limited to 3 characters.

More than one file extension may be point to the same File Type.
e.g. both the extension .Tif and the extension .Tiff may be point to the File Type “TifImage”

At any one time a given file extension may only be associated with one File Type.
e.g. If you change the extension .TIFF to the File Type “txtfile” then it’s normal association with “TifImage” will disappear.

File Types can be displayed in the Windows Explorer GUI: [View, Options, File Types] however the output is usually different to that expected by the command e.g. the File Type “txtfile” is displayed in the GUI as “Text Document”

The ASSOC command followed by just a file extension will display the File Type for that extension.
ASSOC command without any parameters will display all the current file associations.

Assoc command with “.ext=” will delete the association for that file extension.

if you have clicked Always Use This Program To Open This File option turned on then you can change it back so it prompts you to specify a program each time, just delete the association for that file type.

ASSOC .ext=
[where .ext is the file extension].
Now when you double-click on a file of that type, the system will ask you what program you want to use.

Using the command will edit values stored in the registry at HKey_Classes_Root\.

Examples:

View file associations:
ASSOC .jpg

Add file associations:
ASSOC .jpg=jpegfile

Delete a file association:
ASSOC .jpg=

Digging through CLASSES_ROOT entries sometime reveals more than one shell for the same application, for example [open] and [play] these may have differences, changing the default action for a file extension may even invoke a different executable.

ARP command

ARP Command – Address Resolution Protocol

ARP command can display and modify the IP-to-Physical address translation tables used by address resolution protocol.

Syntax

View the contents of the local ARP cache table
ARP -a [inet_addr] [-N if_addr] [-v]

Add a static Arp entry for frequent accessed hosts
ARP -s inet_addr eth_addr [if_addr]

Delete an entry
ARP -d inet_addr [if_addr]

Key

-a

Display current ARP entries. May include more than one network interface. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed.

-g Same as -a.
-N

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

-d

inet_addr Delete the host specified by inet_addr or wildcard * will delete all hosts.

-s

Add the host and associates the Internet address inet_addr with the Physical address eth_addr.The Physical address is given as 6 hexadecimal bytes separated by hyphens. The entry is permanent.

eth_addr Specifies a physical address.
if_addr

If present, this specifies the Internet address of the interface whose address translation table should be modified. If not present, the first applicable interface will be used.

Note:
If two hosts on the same network(Subnet) cannot ping each other, try using ARP -a to list the addresses on each computer to see if they have the correct MAC addresses.

A host’s MAC address can be checked using IPCONFIG. If another host with a duplicate IP address exists on the network, the ARP cache may have had the MAC address for the other computer placed in it. ARP -d is used to delete an entry that may be incorrect.

Examples
ARP command to display the ARP cache tables for all interfaces:
C:\> arp -a

ARP command to display the ARP cache table for the interface on IP address 10.0.0.5
C:\> arp -a -N 10.0.0.5

Add a static ARP cache entry on IP addr 10.1.1.5 to the physical address 00-AA-21-5A-3A-7B
C:\> arp -s 10.1.1.5 00-AA-21-5A-3A-7B

ADmodcmd

Admodcmd for Adding or Modification of Active Directory attributes.

Admodcmd Active Directory Bulk Modify Tool (Command Line Version) – admodify.exe is a GUI based tool for the same command.

Syntax
admodcmd [-dn BaseDN] [-p pagesize] [-s] [-server servername] [-f LDAPFilter] [modification]

Key

-dn BaseDN Base DN to begin the LDAP query.
modification Modification to perform:
Exchange Related Attributes | Terminal Server Attributes
User Account Settings | Mailbox Rights | Custom Attributes
-p pagesize LDAP Page size to use for query.
-s Perform a subtree search (Default is one level search)
-server servername The server to make the changes to.by default, changes are made locally if on a DC else DNS is used to find a DC.
-f LDAPFilter A Valid LDAP filter to use when enumerating objects
The default filter is (objectClass=user).
Changes made with ADModcmd can be undone, as long as the xml log file that logged the changes still exists. These log files are typically located in the same folder as the admodify executable.

Syntax for Undo
admodcmd [-dn BaseDN] [-p pagesize] [-s] [-server servername] -undo logfilename -server servername]

Key:
 logfilename – The log file that contains the changes to be undone.

Servername  – The DC to write the changes to.  by default, changes are made locally if on a DC else DNS is used to find a DC. For information on users that were skipped during an undo process, refer to the undo.log file.

ADDUSERS

ADDUSERS (Command is Available in Windows Resource Kit)

AddUsers command to automate the creation of a large number of users, options can be use to never expire password and user don’t have to change password at next logon.

Syntax

Create Users:
AddUsers /c filename [/s:x] Domain_Name /p:{l|c|d|e}

Dump to file:
AddUsers /d:u filename [/s:x] Domain_Name

Erase Users:
AddUsers /e filename [/s:x] Domain_Name

Key

/c Create User accounts, local groups, and global groups as specified by filename.
/d:u Dump user accounts, local groups, and global groups to filename.
The (:u) is an optional switch that causes current accounts to be written to the specified file in Unicode text format. Choosing to dump current user accounts does not save the account’s passwords or any security information for the accounts.
Note: Password information is not saved in a user account dump and if you use the same file to create accounts, all passwords of newly created accounts will be empty. To back up security information for accounts, use a Tape Backup.
/e Erase the user accounts specified in the file name.
CAUTION: Be careful when erasing user accounts, as it is not possible to recreate an account with the same SID. This option will not erase built-in accounts.
Filename The comma-delimited file that AddUsers uses for data.
/s:x Optional switch that changes the character used for separating fields in the file
e.g. /s: ~ field-separation character “~”
If this option is not specified, the default separator, a comma, is used.
Domain_Name Query the Primary Domain Controller (PDC) of domain.
You can also use \\Servername to specify the machine where user accounts are created or read. AddUsers will use the local computer by default (if you do not specify Domain)
/p: Set account creation options, used along with any combination of the following:
l – Users do not have to change passwords at next logon.
c – Users cannot change passwords.
e – Passwords never expire. (implies l option)
d – Accounts disabled.
By default, all created users are required to change their password at logon.

Example

Create a comma-delimited text file, which contains the new users to be created. Syntax as follows:

[Users]
User Name,Full name, Password, Description, HomeDrive, Homepath, Profile, Script

e.g.

[User]
Jim,James Phillip,,,,,,
Alex,Alex Denuur,,,E:\,E:\users\alexd,,
Ron,Ron Jarook,,,E:\,E:\users\ronj,,

Save the file as C:\NewUsers.txt and execute the command
AddUsers Domain_Name /c c:\NewUsers.txt /p:e