ParsePath
InstallShield 2024 » InstallScript Language Reference
The ParsePath function retrieves the specified part of an existing path. The function works with any valid path, including short paths, long paths, and UNC paths that may or may not include a specific file name. These are some sample paths that can be parsed with this function.
• | \Path1\Path2\Filename.exe |
• | FileName |
• | Filename.exe |
• | \Path1\Path2\Filename |
• | D: |
• | D:\ |
• | \\Server Name\Share Name\Share Directory |
• | Any other legal DOS path |
Syntax
ParsePath ( svReturnString, szPath, nOperation );
Parameters
Parameter |
Description |
||||||||||||||||||
svReturnString |
Returns the part of the path in szPath that is specified by nOperation. |
||||||||||||||||||
szPath |
Specifies the path to parse. When specifying a path that does not include a file name, you must append a backslash to the end of the path before passing it to ParsePath; otherwise the last part of the path will be interpreted as a file name. |
||||||||||||||||||
nOperation |
Specifies which element of the path to return. Pass one of the following predefined constants in this parameter:
|
Return Values
Return Value |
Description |
0 |
Indicates that the function successfully parsed the path string. |
< 0 |
Indicates that the function was unable to parse the path string. |
See Also