Previous Topic: Example: Create Localized Settings TreesNext Topic: Exists Commands


Enumeration Commands

The following are the enumeration commands used in CA DMM scripts:

EnumDirectories

Enumerates the directories under the given directory path.

First parameter:

The path to the directory you want to enumerate.

Second parameter:

The machine (Boolean value)

Example:
var dirList = EnumDirectories("C:\\test");
for (dirIdx in dirList)
{
	var dir = dirList[dirIdx];

	var fileList = EnumFiles("C:\\test\\" + dir);
	for (fileIdx in fileList)
	{
		var file = fileList[fileIdx];
		
		StoreFile("C:\\test\\" + dir + "\\" + file);
	}
}
EnumFiles

Enumerates the files under the given path.

First parameter:

The path to the directory you want to enumerate.

Second parameter:

The machine (Boolean value)

Example:
var dirList = EnumDirectories("C:\\test");
for (dirIdx in dirList)
{
	var dir = dirList[dirIdx];

	var fileList = EnumFiles("C:\\test\\" + dir);
	for (fileIdx in fileList)
	{
		var file = fileList[fileIdx];
		
		StoreFile("C:\\test\\" + dir + "\\" + file);
	}
}
EnumKey

Enumerates the keys in the given registry.

First parameter:

The path to the registry key to enumerate.

Second parameter:

The machine (Boolean value)

Example:
var keyList = EnumKey("HKCU\\Test");
for (keyIdx in keyList)
{
	var key = keyList[keyIdx];
	
	var valueList = EnumValue("HKCU\\Test\\" + key);
	for (valueIdx in valueList)
	{
		var value = valueList[valueIdx];
		
		StoreValue("HKCU\\Test\\" + key, value);
	}
}
EnumValue

Enumerates the values in the given registry key.

First parameter:

The path to the registry key to enumerate.

Second parameter:

The machine (Boolean value)

Example:
var keyList = EnumKey("HKCU\\Test");
for (keyIdx in keyList)
{
	var key = keyList[keyIdx];
	
	var valueList = EnumValue("HKCU\\Test\\" + key);
	for (valueIdx in valueList)
	{
		var value = valueList[valueIdx];
		
		StoreValue("HKCU\\Test\\" + key, value);
	}
}