EnvironmentFunctions.

GetFolderPath(Environment.SpecialFolder) Method

Summary

Gets the path to the system special folder identified by the specified enumeration.
Assembly
NAnt.Core.dll
Namespace
NAnt.Core.Functions
Containing Type
EnvironmentFunctions

Syntax

[Function("get-folder-path")]
public static string GetFolderPath(Environment.SpecialFolder folder)

Examples

Copy "out.log" from the project base directory to the program files directory.

<copy file="out.log" todir="${environment::get-folder-path('ProgramFiles')}" />

Attributes

Type Description
FunctionAttribute Indicates that the method should be exposed as a function in NAnt build files.

Parameters

Name Type Description
folder Environment.SpecialFolder An enumerated constant that identifies a system special folder.

Return Value

Type Description
string The path to the specified system special folder, if that folder physically exists on your computer; otherwise, the empty string ("").