The following are the Apply commands used in CA DMM scripts.
Applies a directory's contents from the source to the destination computer. This command takes two or three parameters. The first parameter is the directory path and is a string value. The second parameter is one of the following overwrite constants or a new directory path. There are three constants which indicate the overwrite method: ALWAYS, NEWER or NEVER. If the overwrite constant is omitted, the default NEWER or the user selected overwrite method is applied. If the second parameter is a new directory path, the contents of the directory <directory name> are applied to <new directory name>. An optional overwrite method is permitted. Only directories that have been stored can be applied. When moving, if the storing path contains a wildcard string, do not include the wildcard in the moving path.
The Directory name (string value)
The new Directory name (string value)
The overwrite method (string value)
ApplyDirectory(<Directory name>, [overwrite method]); or
ApplyDirectory(<Directory name>, <new Directory name>, [overwrite method]);
ApplyDirectory("c:\\My Documents");
ApplyDirectory("c:\\My Documents", NEWER);
ApplyDirectory("c:\\My Documents", "c:\\Word Documents");
ApplyDirectory("c:\\My Documents", "c:\\Word Documents", ALWAYS);
/*Wildcard example*/
ApplyDirectory("c:\\My Documents\\*.fol", "c:\\New Path\\Word Documents", ALWAYS);
Applies a file from the source to the destination computer. This command takes two or three parameters. The first parameter is the file name and is a string value. The second parameter is one of the following overwrite constants or a new file path. There are three constants which indicate the overwrite method: ALWAYS, NEWER or NEVER. If the overwrite constant is omitted, the default NEWER or the user selected overwrite method is applied. If the second parameter is a new file path, the file <file name> is applied to <new file name>. An optional overwrite method is allowed as well. This command recognizes the asterisk (*) as a wildcard. Only files that were stored can be applied. When moving, if the storing path contains a wildcard string, do not include the wildcard in the moving path.
The File name (string value)
The new File name (string value)
The overwrite method (string value)
ApplyFile(<File name>, [overwrite method]); or
ApplyFile(<File name>, <new File name>, [overwrite method]);
ApplyFile("c:\\temp\\file.txt");
/*Wildcard example*/
ApplyFile("c:\\My Documents\\*.txt", "c:\\New Path\\Word Documents", ALWAYS);
Applies a registry key including all of its values or an ini file section with all of its values from the source to the destination computer. This command can take two parameters. Only keys that were stored can be applied.
The Key path (string value)
The new Key path (string value)
ApplyKey(<Key path>, [new Key path]);
Applies a file from the source to the destination computer. If any of the file's data specifies a directory path, it is mapped to the appropriate path.
The File path (string value)
The new File name (string value)
The overwrite method (string value)
ApplyMappedFile(<File name>, [overwrite method]); or
ApplyMappedFile(<File name>, <new File name>, [overwrite method]);
ApplyMappedFile("c:\\temp\\file.txt");
ApplyMappedFile("c:\\My Documents\\file.txt", "c:\\New Path\\Word Documents\\file.txt", ALWAYS);
Applies a registry key and all its values or an ini file section and all its values from the source to the destination machine. If any of the value names or value data is a directory path, they are mapped to the appropriate path. This command can take two parameters. Only keys that were stored can be applied.
The Key path (string value)
The new Key path (string value)
ApplyMappedKey(<Key path>, [new Key path]);
ApplyMappedKey("HKLM\\Software\\Microsoft\\Office\\8.0\\Word\\Data\\Toolbar");
Applies a registry key, all its values and all its subkeys, or an ini file section and all its values from the source to the destination computer. If any of the value names or value data is a directory path, they are mapped to the appropriate path. This command can take two parameters. Only keys that were stored can be applied.
The Key path (string value)
The new Key path (string value)
ApplyMappedSubKeys(<Key path>, [new Key path]);
ApplyMappedSubKeys("HKLM\\Software\\Microsoft\\Office\\8.0\\Word\\Data\\Toolbar");
Applies a registry key value or an .ini file value from the source to the destination computer. If the value name or value is a directory path, it is mapped to the appropriate path. The command can take six parameters. Only values that were stored mapped can be applied mapped.
The Key path (string value)
The Value name (string value)
Note: If the value is the default value, the second parameter should be NULL ("")
The new Key path (string value)
Note: If not moving the value to new location, the third parameter should be NULL ("")
The delimiter (string value)
Shortpaths indicator (Boolean value)
If moving, the new Value name (string value)
ApplyMappedValue(<Key path>, <Value name>, [new Key path], [delimiter], [shortpaths], [new Value name]);
ApplyMappedValue("HKCU\\Software\\Microsoft\\Office\\8.0\\Common\\Toolbar", "Tooltips");
ApplyMappedValue("HKCU\\Software\\Microsoft\\Office\\8.0\\Common\\Toolbar", "Tooltips","HKLM\\Software\\Microsoft\\Office\\8.0\\Common\\Toolbar");
ApplyMappedValue("HKCU\\Software\\Microsoft\\Office\\8.0\\Common\\Toolbar", "Tooltips", "HKLM\\Software\\Microsoft\\Office\\8.0\\Common\\Toolbar", ";");
ApplyMappedValue("HKCU\\Software\\Microsoft\\Office\\8.0\\Common\\Toolbar", "Tooltips", "", ";");
Applies a registry key, all of its values and all of its subkeys from the source to the destination computer. This command can take two parameters. Only keys that were stored can be applied.
The Key path (string value)
The new Key path (string value)
ApplySubKeys(<Key path>, [new Key path]);
ApplySubKeys("HKCU\\Software\\Microsoft\\Office\\8.0\\Word");
Applies a registry key value from the source to the destination computer. This command takes four parameters. Only values that were stored can be applied.
The Key path (string value)
The Value name (string value)
The new Key path (string value)
The new Value name (string value)
ApplyValue(<Key path>, <Value name>, [new Key path], [new Value name]);
ApplyValue("HKCU\\Software\\Microsoft\\Office\\8.0\\Common\\Toolbar", "Tooltips");
Deletes a key and all of its values and subkeys from the registry or ini files. Returns False if there were problems deleting the key. If the key does not exist, it returns True. If the path is to an ini file, then all sections in the ini file are deleted.
The Key path (string value)
DeleteKey( "HKCU\\Software\\MyApp"); DeleteKey( "c:\\windows\\test.ini\\Keyname"); /* all keys deleted */ DeleteKey( "c:\\windows\\test.ini");
Deletes a value from the registry or ini files. Returns False if there were problems deleting the value. If the value does not exist, it will return True.
The Key path (string value)
The Value Name (string value)
DeleteValue( "HKCU\\Software\\MyApp", "SomeValue");
DeleteValue( "c:\\windows\\win.ini\", "SomeValue");
Creates or sets a key.
The Key path (string value)
SetKey("HKLM\\New Key");
The SetValue command creates or sets a key value. If the key does not exist, this command creates the key.
This command has the following format:
SetValue(<FilePath>, <ValueName>, <Data>, <Type>)
(For registry) Represents the key path (string value).
(For XML) Represents the complete file path.
(For registry) Represents the value name (string value).
(For XML) Represents the valid XPath query.
Represents the value.
Represents the value type.
The following are the registry values that are accepted:
|
Value |
Format |
Example |
|---|---|---|
|
STRING |
string |
"Brian" |
|
DWORD |
number |
"1999" |
|
BINARY |
binary |
"af 45 99 31" |
|
DWORD_LITTLE_ENDIAN |
number |
"1234" |
|
DWORD_BIG_ENDIAN |
number |
"1234" |
|
SYMBOLIC_LINK |
binary |
"af 45 99 31" |
|
MULTI_STRING |
binary |
"af 45 99 31" |
|
RESOURCE_LIST |
binary |
"af 45 99 31" |
|
EXPAND_STRING |
string |
"Brian" |
|
FULL_RESOURCE_DESCRIPTOR |
binary |
"af 45 99 31" |
|
RESOURCE_REQUIREMENTS_LIST |
binary |
"af 45 99 31" |
Examples: Set a Key Value
SetValue("HKLM\\Destination", "String Value", "This is a string value", STRING);
SetValue("C:\\abc.xml", "/docnode/node1/node2", "It is a node", "");
|
Copyright © 2013 CA.
All rights reserved.
|
|