The CA DMM scripts use the following Apply commands:
Applies the contents of a directory 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. The three constants which indicate the overwrite method are: ALWAYS, NEWER, or NEVER. If the overwrite constant is omitted, the default NEWER or the overwrite method the user selects 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. You can apply only the stored directories. If the storing path contains a wildcard string during movement, 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*/
Applies a file from the source to the destination computer. This command takes two or three parameters. The three constants which indicate the overwrite method are: ALWAYS, NEWER, or NEVER. If the overwrite constant is omitted, the default NEWER or the overwrite method that the user selects, 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 too. This command recognizes the asterisk (*) as a wildcard. Only the stored files can be applied. If the storing path contains a wildcard string during movement, 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 or an ini file section with all of its values from the source to the destination computer. This command can take two parameters. Only the stored keys 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 data of the file 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 or an ini file section and all its values from the source to the destination system. 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 the stored keys 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, its sub keys, values, or an ini file section and all its values from the source to the destination system. 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 the stored keys 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 the stored and mapped values can be applied and mapped.
The Key path (string value)
The Value name (string value)
Note: If the value is the default value, the second parameter must be NULL ("").
The new Key path (string value)
Note: If you do not move the value to a new location, the third parameter must be NULL ("").
The delimiter (string value)
Shortpaths indicator (Boolean value)
If it moves, 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 sub keys from the source to the destination computer. This command can take two parameters. Only the stored keys 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 the stored values 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 sub keys 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 returns 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 accepted registry values are as follows:
|
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 © 2014 CA Technologies.
All rights reserved.
|
|